Skip to content
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

feat: prometheus translation add support for rw2 #35583

Conversation

jmichalek132
Copy link
Contributor

Description:

Draft starting the work on adding support for remote write 2.0 in the translation package.

Link to tracking Issue: #33661

Testing:

Documentation:

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@jmichalek132
Copy link
Contributor Author

Closing in favor of #35703.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants