Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
fix: rename config to max span age
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach committed Feb 3, 2022
1 parent 2cf5d44 commit 785fa85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ data:
tableName: jaeger
outputLocation: s3://my-jaeger-s3-bucket-athena-results/
workGroup: jaeger
maxSpanAge: 336h
---
apiVersion: v1
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugin/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Athena struct {
TableName string
WorkGroup string
OutputLocation string
MaxTimeframe string
MaxSpanAge string
}

type Configuration struct {
Expand Down
20 changes: 10 additions & 10 deletions plugin/s3spanstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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) {
Expand Down

0 comments on commit 785fa85

Please sign in to comment.