Skip to content

receive: enable ExportCreatedMetric in OTLP translator#8766

Open
alliasgher wants to merge 1 commit intothanos-io:mainfrom
alliasgher:feat-otlp-export-created-metric
Open

receive: enable ExportCreatedMetric in OTLP translator#8766
alliasgher wants to merge 1 commit intothanos-io:mainfrom
alliasgher:feat-otlp-export-created-metric

Conversation

@alliasgher
Copy link
Copy Markdown

What does this do?

Without ExportCreatedMetric, the StartTimeUnixNano field on OTLP counters and histograms was silently dropped during translation to Prometheus remote write. This breaks counter reset detection for downstream systems that rely on the _created timestamp to distinguish a genuine counter reset from a fresh series.

Setting ExportCreatedMetric: true in otlptranslator.Settings causes the translator to emit a <metric>_created series carrying the StartTimeUnixNano value, matching the behaviour described in the Prometheus exposition format spec.

Fixes #8637

Checklist

  • go test ./pkg/receive/ passes
  • gofmt clean
  • Pre-existing failure in pkg/receive/writecapnp is unrelated (also fails on unmodified main)

Signed-off-by: Ali alliasgher123@gmail.com

Without ExportCreatedMetric, the StartTimeUnixNano field on OTLP
counters and histograms was silently dropped during translation to
Prometheus remote write. This broke counter reset detection for
downstream systems that rely on the _created timestamp to distinguish
a genuine counter reset from a fresh series.

Setting ExportCreatedMetric: true in the otlptranslator.Settings causes
the translator to emit a <metric>_created series carrying the
StartTimeUnixNano value, matching the behaviour described in the
Prometheus exposition format spec.

Fixes thanos-io#8637

Signed-off-by: Ali <alliasgher123@gmail.com>
@alliasgher
Copy link
Copy Markdown
Author

The Documentation check failure is broken external links in pre-existing docs (grafana.com/docs/loki/... → 404 and db.cs.cmu.edu DNS timeout in docs/proposals-done/201909-thanos-sharding.md and docs/components/store.md). Unrelated to this PR which only touches pkg/receive/handler_otlp.go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

receive: Enable ExportCreatedMetric to preserve StartTimeUnixNano from OTLP

1 participant