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

Convert resource attributes to labels in prometheus remote write exporter #26

Conversation

amanbrar1999
Copy link

@amanbrar1999 amanbrar1999 commented Oct 27, 2020

Description:
Added missing functionality of converting resource attributes to labels in Prometheus Remote Write Exporter.

Furthermore, this PR merges the ideas of a Prometheus "External Label" with OTLP "Resource Attributes". From my understanding an "external label" is a label customer's can add in Prometheus' global config's, and they are allowed to start with "__" unlike regular labels. Since resource attributes to not appear to have any restrictions for starting with "__", I believe it is safe to merge these concepts.

This solves issue open-telemetry#1892 because customer's can specify cortex's "cluster" and "__replica__" labels using the resourceprocessor, which would be equivalent to the suggested way to do it on Cortex's website (using external labels: https://cortexmetrics.io/docs/production/ha-pair-handling/)

Also note that this PR is not as long as it seems, a lot of lines are test data

Link to tracking Issue:
open-telemetry#1892

Testing:
Unit tests have been added, and manual testing by exporting to cortex has shown resource attributes successfully appear as labels with no differences in the metrics graphs, which is expected

Documentation:
No documentation has been added as this was missing, expected functionality

@amanbrar1999 amanbrar1999 marked this pull request as ready for review October 28, 2020 01:39
@amanbrar1999
Copy link
Author

This PR is now obsolete

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

Successfully merging this pull request may close these issues.

2 participants