-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Add primitive support for ingesting OTLP delta metrics as-is #16360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@beorn7 @ArthurSens - this is a PR for simple ingestion of raw delta samples as discussed in the dev summit today (in draft - no proper testing yet!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start!! Let's finish tests and also add a bit of documentation on the feature flag saying that this is a very early stage implementation of your proposal. People can enable and start experimenting using deltas with existing PromQL functions, but we will collect feedback and likely build more things that improve the experience around deltas
storage/remote/otlptranslator/prometheusremotewrite/otlp_to_openmetrics_metadata.go
Outdated
Show resolved
Hide resolved
71d4da7
to
0b0bee8
Compare
To consider: should the flag be called My preference would be to call it Edit: actually I think I want two flags - one for ingesting deltas via the otlp endpoint, and one for temporality-aware functions See: #16360 (comment). I've also changed the flag name to otlp-native-delta-ingestion. |
This is ready for review - I've added tests and did some manual e2e testing, and added a bit of documentation about the feature. |
Currently swamped with other reviews (that have been waiting for far too long and where I am pretty much the only available reviewer). I'm happy to look at this in detail ASAP (but that might no be very soon). I know the @ArthurSens is on vacation right now. Let's see who gets to this first. Even better if we could find another reviewer for this to speed things up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, thank you for continuing the work!
Almost everything looks good, but histograms are looking a bit weird to me... could you clarify?
storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go
Outdated
Show resolved
Hide resolved
storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw_test.go
Outdated
Show resolved
Hide resolved
storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw_test.go
Outdated
Show resolved
Hide resolved
storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw_test.go
Outdated
Show resolved
Hide resolved
912188b
to
68aa01b
Compare
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com> Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
18e34fb
to
a48bee8
Compare
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
One interesting thing I just noticed - when attempting to use This is because the counter reset hint is prometheus/promql/functions.go Lines 204 to 206 in c88d0b0
There's not a similar error for the delta counters (where the type is set to unknown for now) since there's no real type checks for counters at the moment. I think the current PR implementation is fine as it is, this comment is just to note this behaviour. |
@ArthurSens This is ready for re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Let's give @beorn7 a week to review the PR, if he doesn't fine a chance to do it then let's merge and continue the proposal :) |
Don't wait for me. I trust you to do the right thing. And if it's not the right thing after all, it isn't the end of the world because it is behind a feature flag. |
Alright, thank you! Let's merge it then :) |
Introduces the `-distributor.otel-native-delta-ingestion` flag (and corresponding per-tenant setting), which enables primitive OTEL delta metrics ingestion via the OTLP endpoint. This feature was implemented in Prometheus in prometheus/prometheus#16360. This PR allows Mimir users to enable this feature too. As per the Prometheus PR: > This allows otlp metrics with delta temporality to be ingested and stored as-is, with metric type unknown. To get "increase" or "rate", `sum_over_time(metric[<interval>])` (`/ <interval>`) can be used. > This is the first step towards implementing prometheus/proposals#48. That proposal has additional suggestions around type-aware functions and making the rate() and increase() functions work for deltas too. However, there are some questions around the best way to do querying over deltas, so having this simple implementation without changing any PromQL functions allow us to get some form of delta ingestion out there gather some feedback to decide the best way to go further. --------- Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Part of #12763
This PR adds primitive support for otlp delta metrics. This allows otlp metrics with delta temporality to be ingested and stored as-is, with metric type unknown. To get "increase" or "rate",
sum_over_time(metric[<interval>])
(/ <interval>
) can be used.This is the first step towards implementing prometheus/proposals#48. That proposal has additional suggestions around type-aware functions and making the
rate()
andincrease()
functions work for deltas too. However, there are some questions around the best way to do querying over deltas, so having this simple implementation without changing any PromQL functions allow us to get some form of delta ingestion out there gather some feedback to decide the best way to go further.The feature can be enabled with
--enable-feature=otlp-native-delta-ingestion
.Testing
Unit tests have been written for delta sums/histograms/exp histograms.
Manual end to end testing has been done - can run with https://github.com/fionaliao/prom-otel-delta-support-testing to get some demo delta and cumualtive counters and histograms, example screenshots below.