Repository navigation
perf(productmetrics): export metrics every 30m instead of 60s - #1610
Merged
Merged
Conversation
The product-metrics OTLP pipeline built its PeriodicReader with no interval option, so it flushed to the vendor ingest at mecatl.metrics.stacklok.com at the OTel SDK's default 60s cadence. This pipeline has no need for minute-granularity export; override the reader interval to 30m via a named exportInterval constant, cutting export traffic ~30x. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jhrozek
approved these changes
Sep 15, 2026
ChrisJBurns
approved these changes
Sep 15, 2026
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Change the product-metrics OTLP export cadence to the ingest endpoint at
mecatl.metrics.stacklok.comfrom every 60s to every 30m.Why
NewProviderininternal/adapter/productmetrics/provider.gobuilt itsPeriodicReaderwith no interval option, so it flushed collected metrics at the OTel SDK's defaultdefaultIntervalof 60s. This pipeline is a low-frequency product-telemetry path (heartbeat/feature snapshots), not an operational monitoring feed — minute-granularity export buys nothing and generates ~30x more export traffic to the vendor destination than needed.Change
exportInterval = 30 * time.Minuteconstant (mirroring the existingDefaultHeartbeatIntervalstyle), with a comment noting it overrides the SDK's 60s default.sdkmetric.WithInterval(exportInterval)toNewPeriodicReader.Notes
DefaultHeartbeatInterval(24h), the feature-heartbeat fire.go buildandgo vetpass.🤖 Generated with Claude Code