Repository navigation
Conversation
…ting the request FromMetrics still returned an error for two kinds of input that only affect one metric: a metric with no type (MetricTypeEmpty), and an exponential histogram data point with a scale below -4, the lowest native histogram schema (OTLP allows scales down to -10). The handler then rolled back the whole request and answered 500, so every other metric in it was lost and the sender retried the same request. Report both as warnings instead, as prometheus#19343 and prometheus#20536 did for empty data points and unsupported temporality. A metric with no type has no data points and is counted as empty_data_points. A data point with a too low scale is dropped on its own and counted under a new histogram_scale_too_low category. Signed-off-by: Rohit Behera <[email protected]>
r0h1tb
requested review from
a team,
ArthurSens,
aknuds1,
bwplotka,
cstyan and
jesusvazquez
as code owners
November 25, 2026 17:43
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.
Which issue(s) does the PR fix:
No issue filed. Follow-up to #20536, covering the two cases I mentioned there.
FromMetricsstill returns an error for two inputs that only concern one metric, soConsumeMetricsrolls back the whole OTLP request and the handler answers 500 (which senders retry):MetricTypeEmpty):could not get aggregation temporality for bad_metric as it has unsupported metric type Emptycannot convert exponential to native histogram. Scale must be >= -4, was -5Both now become warnings, as in #19343 and #20536. A metric with no type has no data points either, so it is reported like the empty data points case and counted as
empty_data_points. A data point with a scale that is too low is dropped by itself, and the other data points of the metric are kept. It is counted under a newhistogram_scale_too_lowcategory ofprometheus_api_otlp_translation_warnings_total.Tests: in
TestOTLPWriteHandler, both cases are added to "dropped metric does not reject healthy metrics" and to "translation warnings metric". Without the change, they get 500 or an error.TestTemporalityhad an "empty metric type errors" case, from the delta ingestion work in #16360. It now expects the warning and has a healthy metric next to the dropped one.exponentialToNativeHistogramkeeps its scale check and its test.Release notes for end users (ALL commits must be considered).
Reviewers should verify clarity and quality.