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

Change the way resource attributes are populated (unbreaks a 2.0 change) #1565

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

mariomac
Copy link
Contributor

@mariomac mariomac commented Jan 23, 2025

After discussing internally with some users, there was a misinterpretation about the resource labels and attributes, so this PR:

  • Restores the meta_source_labels from version 1.9, but deprecates it and shows a warning if a user is still using it. There are new users adopting this option in the past days and would not be nice that one week after configuring everything, Beyla 2.0 breaks it.

  • Adds the resource_labels option as a map, allowing to specify any OTEL resource attribute (not only limited to service name and NS). Currently only name and namespace are considered, but in a following PR, any other attribute is going to be forwarded as a resource attribute.

  • The resource.opentelemetry.io/ annotations are not configurable anymore, as they are an opinionated and standard way to configure any resource attribute, not only service name and namespace (like OTEL_RESOURCE_ATTRIBUTES). In a following PR, we will handle any resource attribute specified in this format.

@mariomac mariomac requested a review from a team as a code owner January 23, 2025 10:56
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 46.66667% with 16 lines in your changes missing coverage. Please review.

Project coverage is 71.14%. Comparing base (285162b) to head (b548ef0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/components/beyla.go 20.00% 12 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1565      +/-   ##
==========================================
- Coverage   71.15%   71.14%   -0.01%     
==========================================
  Files         197      197              
  Lines       19671    19689      +18     
==========================================
+ Hits        13996    14007      +11     
- Misses       4995     5000       +5     
- Partials      680      682       +2     
Flag Coverage Δ
integration-test 53.24% <13.33%> (-0.08%) ⬇️
k8s-integration-test 53.79% <46.66%> (+0.43%) ⬆️
oats-test 34.40% <13.33%> (+0.14%) ⬆️
unittests 47.30% <43.33%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM! Just a question because I might've missed it, do we have an integration test with the new way to override the name?

@mariomac
Copy link
Contributor Author

@grcevski we have it from the previous implementation. We just took care that current tests were not broken after changing the spec.

@mariomac mariomac merged commit cbb6303 into grafana:main Jan 23, 2025
15 checks passed
@mariomac mariomac deleted the res-attrs branch January 23, 2025 14:47
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