-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Migrate OTLP endpoint to PRW 2.0 for ingestion #16784
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
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.
Epic work, thanks!
Looks good in general, some minor suggestions only 👍🏽
} | ||
|
||
return labels | ||
return c.builder.Labels() |
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.
Is there a reason why we return built labels and not builder? Looks like we expect to still add at least name after this. By returning builder we make it a bit more efficient in theory. (could be done in separate PR)
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.
Ah, so it made sense in the past as we were creating proto labels later. But now we operate on labels.Labels, so maybe it's viable to pass builders/scratchbuilders?
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.
We have to take a single set of base attributes, and add one or two labels (e.g. for name with _sum
, or _bucket
suffix) to multiple different label sets. What i've done is use a ScratchBuilder to build the base attributes, and then use a Builder to append the special ones. There isn't a copy method I can see for ScratchBuilder, otherwise I could use that to build multiple variations of the same set of labels. Let me know if there is a better pattern.
storage/remote/otlptranslator/prometheusremotewrite/helper_test.go
Outdated
Show resolved
Hide resolved
storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go
Outdated
Show resolved
Hide resolved
storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Part of #16610. See #16610 (comment) for alternatives.
The current OTLP endpoint translates OTLP to PRW 1.0, and then appends the metrics to the TSDB using the PRW 1.0 ingestion path. This PR migrates this translation logic to instead translate to PRW 2.0 and use the PRW 2.0 ingestion path.
Currently, the PRW 1.0 endpoint just ignores metadata, so we are dropping type, help, and unit information. Migrating to 2.0 will fix that. It will also allow the OTLP endpoint to use the type and unit feature implementation without re-implementing it in the translation layer.
This PR can be largely summarized as:
writeV2
instead ofwrite
The existing e2e tests in write_test.go didn't need any changes, which helps to show that this doesn't change any behavior.