feat: prometheus translation add support for rw2#35583
Closed
jmichalek132 wants to merge 4 commits into
Closed
Conversation
ArthurSens
reviewed
Oct 4, 2024
Member
ArthurSens
left a comment
There was a problem hiding this comment.
Thank you @jmichalek132! Super nice to see progress here :)
I think we can make this initial task even smaller, so we can get something mergeable faster. What do you think?
| // createAttributes creates a slice of Prometheus Labels with OTLP attributes and pairs of string values. | ||
| // Unpaired string values are ignored. String pairs overwrite OTLP labels if collisions happen and | ||
| // if logOnOverwrite is true, the overwrite is logged. Resulting label names are sanitized. | ||
| func createAttributesV2(resource pcommon.Resource, attributes pcommon.Map, externalLabels map[string]string, |
Member
There was a problem hiding this comment.
I wonder if we could reduce the scope of the first PR even further. Maybe just translate gauges datapoints to samples, without any labels.
Comment on lines
+23
to
+25
| tsMap, err := FromMetricsV2(payload.Metrics(), settings) | ||
| require.NoError(t, err) | ||
| require.NotNil(t, tsMap) |
Member
There was a problem hiding this comment.
You plan to change this, right? Like, asserting that we return real metrics
Comment on lines
+20
to
+28
| labels := createAttributesV2( | ||
| resource, | ||
| pt.Attributes(), | ||
| settings.ExternalLabels, | ||
| nil, | ||
| true, | ||
| model.MetricNameLabel, | ||
| name, | ||
| ) |
Member
There was a problem hiding this comment.
What do you think about ignoring labels for the first PR?
Signed-off-by: Juraj Michalek <juraj.michalek132@gmail.com>
Signed-off-by: Juraj Michalek <juraj.michalek132@gmail.com>
Contributor
Author
|
Closing in favor of #35703. |
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.
Description:
Draft starting the work on adding support for remote write 2.0 in the translation package.
Link to tracking Issue: #33661
Testing:
Documentation: