Skip to content

Commit

Permalink
Add export interval parameter for the optl exporter
Browse files Browse the repository at this point in the history
Signed-off-by: Lionel Jouin <lionel.jouin@est.tech>
  • Loading branch information
LionelJouin committed Sep 21, 2023
1 parent 1eac726 commit e965965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/tools/opentelemetry/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func InitSpanExporter(ctx context.Context, exporterURL string) trace.SpanExporte
}

// InitOPTLMetricExporter - returns an instance of OpenTelemetry Metric Exporter.
func InitOPTLMetricExporter(ctx context.Context, exporterURL string) sdkmetric.Reader {
func InitOPTLMetricExporter(ctx context.Context, exporterURL string, exportInterval time.Duration) sdkmetric.Reader {
if !IsEnabled() {
return nil
}
Expand All @@ -77,7 +77,7 @@ func InitOPTLMetricExporter(ctx context.Context, exporterURL string) sdkmetric.R

return sdkmetric.NewPeriodicReader(
exporter,
sdkmetric.WithInterval(10*time.Second),
sdkmetric.WithInterval(exportInterval),
)
}

Expand Down

0 comments on commit e965965

Please sign in to comment.