-
Notifications
You must be signed in to change notification settings - Fork 524
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
OTLP: Convert start timestamps to Prom created timestamps #9131
Conversation
afc98c1
to
cb93c3e
Compare
cb93c3e
to
2925e8e
Compare
3876b9f
to
3937656
Compare
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
84dd479
to
82e2b6a
Compare
This PR includes the latest changes from Mimir Prometheus so I'm waiting on #9148 before moving forward. |
- Enable conversion of OTel start timestamps to Prometheus zero samples to mark series start | ||
- `-distributor.otel-created-timestamp-zero-ingestion-enabled` |
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.
In OTel it is called StartTimeUnixNano
, should we call this flag -distributor.otel-starttimeunixnano-zero-ingestion-enabled
?
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.
As a point of reference, the OTel SDK calls it StartTimestamp
. Do you gain anything from including the unixnano suffix? Technically, Prometheus created timestamps are in milliseconds, but there's no point in including that kind of detail when referring to them, is there?
I guess it might make sense to refer to "start timestamps" in this flag rather than "created timestamps", since you're converting the former. My original thinking, OTOH, was to refer to support for created timestamps via zero samples (since zero samples are a way to represent created timestamps) in the OTLP endpoint.
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.
As a point of reference, the OTel SDK calls it StartTimestamp. Do you gain anything from including the unixnano suffix?
No, you have a good point to not add unixnano!
I guess it might make sense to refer to "start timestamps" in this flag rather than "created timestamps", since you're converting the former. My original thinking, OTOH, was to refer to support for created timestamps via zero samples (since zero samples are a way to represent created timestamps) in the OTLP endpoint.
I don't have a strong preference, I was just thinking that people coming from OTel might not understand this flag. Quite unfortunate that OpenMetrics and OTel are using different names here :/
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.
Yeah, I guess you've got a point. Maybe e.g. -otel-start-time-zero-ingestion-enabled
(same as yours, without "unixnano")?
# Conflicts: # go.mod # go.sum # pkg/distributor/otel.go # vendor/github.com/prometheus/prometheus/storage/remote/write_handler.go # vendor/modules.txt
// client_golang v1.20.0 has some bugs https://github.com/prometheus/client_golang/issues/1605, https://github.com/prometheus/client_golang/issues/1607 | ||
// Stick to v1.19.1 until they are fixed. | ||
replace github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.19.1 |
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.
Taking a look at them right now!
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!
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
* OTLP: Convert start timestamps to Mimir created timestamps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * bump to latest mimir-prometheus Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com> * make use of annotations --------- Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com> Co-authored-by: Jesus Vazquez <jesus.vazquez@grafana.com> Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com> (cherry picked from commit b58a08b)
) * OTLP: Convert start timestamps to Mimir created timestamps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * bump to latest mimir-prometheus Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com> * make use of annotations --------- Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com> Co-authored-by: Jesus Vazquez <jesus.vazquez@grafana.com> Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com> (cherry picked from commit b58a08b) Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-9131-to-r306 origin/r306
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x b58a08b17fbe7a53d59ca48995e57e38b893417e
# Push it to GitHub
git push --set-upstream origin backport-9131-to-r306
git switch main
# Remove the local backport branch
git branch -D backport-9131-to-r306 Then, create a pull request where the |
What this PR does
In the OTLP endpoint, support converting OTel data point start timestamps to Mimir zero samples 1 millisecond before the sample itself, iff the following are true:
Includes grafana/mimir-prometheus#684.
Which issue(s) this PR fixes or relates to
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.