diff --git a/README.md b/README.md index 10d3c55..9b1e1c0 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,7 @@ data: tableName: jaeger outputLocation: s3://my-jaeger-s3-bucket-athena-results/ workGroup: jaeger + maxSpanAge: 336h --- apiVersion: v1 @@ -309,7 +310,7 @@ spec: storage: type: grpc-plugin grpcPlugin: - image: ghcr.io/johanneswuerbach/jaeger-s3:v0.1.1 + image: ghcr.io/johanneswuerbach/jaeger-s3:v0.1.5 options: grpc-storage-plugin: binary: /plugin/jaeger-s3 diff --git a/plugin/config/config.go b/plugin/config/config.go index 04c0dfe..86ae9c1 100644 --- a/plugin/config/config.go +++ b/plugin/config/config.go @@ -12,7 +12,7 @@ type Athena struct { TableName string WorkGroup string OutputLocation string - MaxTimeframe string + MaxSpanAge string } type Configuration struct { diff --git a/plugin/s3spanstore/reader.go b/plugin/s3spanstore/reader.go index deaffa4..59549c4 100644 --- a/plugin/s3spanstore/reader.go +++ b/plugin/s3spanstore/reader.go @@ -18,24 +18,24 @@ import ( ) func NewReader(logger hclog.Logger, svc *athena.Client, cfg config.Athena) (*Reader, error) { - maxTimeframe, err := time.ParseDuration(cfg.MaxTimeframe) + maxSpanAge, err := time.ParseDuration(cfg.MaxSpanAge) if err != nil { return nil, fmt.Errorf("failed to parse max timeframe: %w", err) } return &Reader{ - svc: svc, - cfg: cfg, - logger: logger, - maxTimeframe: maxTimeframe, + svc: svc, + cfg: cfg, + logger: logger, + maxSpanAge: maxSpanAge, }, nil } type Reader struct { - logger hclog.Logger - svc *athena.Client - cfg config.Athena - maxTimeframe time.Duration + logger hclog.Logger + svc *athena.Client + cfg config.Athena + maxSpanAge time.Duration } const ( @@ -47,7 +47,7 @@ func (r *Reader) DefaultMaxTime() time.Time { } func (r *Reader) DefaultMinTime() time.Time { - return r.DefaultMaxTime().Add(-r.maxTimeframe) + return r.DefaultMaxTime().Add(-r.maxSpanAge) } func (s *Reader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) {