Skip to content

Commit

Permalink
Set lookback in ES rollover to distant past
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay committed Jul 28, 2021
1 parent 64461af commit 3783edb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugin/storage/es/spanstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,17 @@ type SpanReaderParams struct {

// NewSpanReader returns a new SpanReader with a metrics.
func NewSpanReader(p SpanReaderParams) *SpanReader {
maxSpanAge := p.MaxSpanAge
// If rollover is enabled set lookback far into the past
// In rollover only read alias is used to query the data so looking far into the past should
// not affect performance.
if p.UseReadWriteAliases {
maxSpanAge = time.Hour * 24 * 365 * 100
}
return &SpanReader{
client: p.Client,
logger: p.Logger,
maxSpanAge: p.MaxSpanAge,
maxSpanAge: maxSpanAge,
serviceOperationStorage: NewServiceOperationStorage(p.Client, p.Logger, 0), // the decorator takes care of metrics
spanIndexPrefix: indexNames(p.IndexPrefix, spanIndex),
serviceIndexPrefix: indexNames(p.IndexPrefix, serviceIndex),
Expand Down

0 comments on commit 3783edb

Please sign in to comment.