Skip to content

feat: add otlp exampler support #223

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

Merged
merged 19 commits into from
Feb 26, 2025
Merged

Conversation

kirankumar-grootan
Copy link
Contributor

@kirankumar-grootan kirankumar-grootan commented Nov 26, 2024

Fixes #207

@kirankumar-grootan kirankumar-grootan marked this pull request as draft November 26, 2024 19:50
@kirankumar-grootan kirankumar-grootan marked this pull request as ready for review December 29, 2024 05:32
@gaby
Copy link
Collaborator

gaby commented Jan 21, 2025

@kirankumar-grootan Can you add a unit-test for this?

@kirankumar-grootan
Copy link
Contributor Author

@gaby I added a test case for this, which requires some setup for the OTLP part. I included a helper function within the same test file. Should I move it to a separate file, or is it better to keep it at the end of the test file?

Copy link
Collaborator

@gaby gaby left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, just two simple comments.

@gaby
Copy link
Collaborator

gaby commented Feb 12, 2025

@kirankumar-grootan Added some comments, thanks for the PR 💪

@kirankumar-grootan
Copy link
Contributor Author

@gaby addressed all the comments in the MR

@gaby
Copy link
Collaborator

gaby commented Feb 13, 2025

@kirankumar-grootan You may have to run "go mod tidy"

@kirankumar-grootan
Copy link
Contributor Author

kirankumar-grootan commented Feb 13, 2025

@kirankumar-grootan You may have to run "go mod tidy"

applied go mod tidy -go=1.22 but its is changing from go 1.22 to go 1.22.0. and its due to the otlp sdk
go: go.opentelemetry.io/auto/[email protected] requires [email protected], but 1.22 is requested.

this is the version im using in my local go version go1.22.12 darwin/amd64

Copy link
Collaborator

@gaby gaby left a comment

Choose a reason for hiding this comment

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

LGTM, I do wonder if making the "EnableOpenMetrics" a param makes sense though

@gaby
Copy link
Collaborator

gaby commented Feb 18, 2025

@kirankumar-grootan Thoughts?

@gaby
Copy link
Collaborator

gaby commented Feb 18, 2025

@kirankumar-grootan can you run "go mod tidy" once more. Thanks. Will merge after

@kirankumar-grootan
Copy link
Contributor Author

kirankumar-grootan commented Feb 19, 2025

LGTM, I do wonder if making the "EnableOpenMetrics" a param makes sense though

Hmm, I hadn't considered making it optional since we're using OTLP and metrics for all our services.

The fact is, traces are only scraped with exemplars when the Accept: application/openmetrics-text header is included, which happens only if Prometheus is enabled with the exemplar feature. Otherwise, it will scrape standard non-exemplar metrics, so the fallback happens automatically without any extra effort.

I will check and let you know if there is a better way to turn this on when required.

@kirankumar-grootan
Copy link
Contributor Author

kirankumar-grootan commented Feb 19, 2025

@kirankumar-grootan can you run "go mod tidy" once more. Thanks. Will merge after

no changes to commit after go mod tidy

@gaby
Copy link
Collaborator

gaby commented Feb 19, 2025

LGTM, I do wonder if making the "EnableOpenMetrics" a param makes sense though

Hmm, I hadn't considered making it optional since we're using OTLP and metrics for all our services.

The fact is, traces are only scraped with exemplars when the Accept: application/openmetrics-text header is included, which happens only if Prometheus is enabled with the exemplar feature. Otherwise, it will scrape standard non-exemplar metrics, so the fallback happens automatically without any extra effort.

I will check and let you know if there is a better way to turn this on when required.

That's fine then.

@gaby
Copy link
Collaborator

gaby commented Feb 19, 2025

@kirankumar-grootan can you run "go mod tidy" once more. Thanks. Will merge after

no changes to commit after go mod tidy

Ahhh, you have to rebase your branch. Its complaining about merge conflict with master

Copy link
Collaborator

@gaby gaby left a comment

Choose a reason for hiding this comment

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

LGTM

@gaby
Copy link
Collaborator

gaby commented Feb 24, 2025

@kirankumar-grootan For some reason GitHub says that commits do not have verified signatures, so it doesn't let me merge it.

@kirankumar-grootan kirankumar-grootan force-pushed the otlp-exampler branch 3 times, most recently from db2313c to 24813f5 Compare February 25, 2025 09:03
@kirankumar-grootan
Copy link
Contributor Author

@kirankumar-grootan For some reason GitHub says that commits do not have verified signatures, so it doesn't let me merge it.

IDK what went wrong with my gpg key. now all commits are verified

@kirankumar-grootan kirankumar-grootan force-pushed the otlp-exampler branch 2 times, most recently from 4fbaddb to 6fbc534 Compare February 25, 2025 09:13
@gaby
Copy link
Collaborator

gaby commented Feb 25, 2025

@kirankumar-grootan That fixed it. Will merge today. Thank you

@gaby gaby changed the title added otlp exampler support feat: add otlp exampler support Feb 26, 2025
@gaby gaby added the enhancement New feature or request label Feb 26, 2025
@gaby gaby merged commit fc6cb86 into ansrivas:master Feb 26, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Examplar Metrics
2 participants