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

fix(otel): fix resource attribute parsing #2608

Conversation

hairyhenderson
Copy link
Contributor

Description

Support for OTEL_RESOURCE_ATTRIBUTES was broken as koanf was parsing it, but not as the right type. We need to parse it in a custom way.

Closes issue(s)

Fixes #2607

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have updated the documentation (README.md and /website/docs)
  • I have followed the contributing guide

Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for go-feature-flag-doc-preview canceled.

Name Link
🔨 Latest commit abe5a8b
🔍 Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/67294310a84e2600084f87d0

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 12 lines in your changes missing coverage. Please review.

Project coverage is 85.04%. Comparing base (f953ddf) to head (abe5a8b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/relayproxy/config/config.go 58.62% 9 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2608      +/-   ##
==========================================
- Coverage   85.19%   85.04%   -0.16%     
==========================================
  Files         102      102              
  Lines        4687     4720      +33     
==========================================
+ Hits         3993     4014      +21     
- Misses        552      561       +9     
- Partials      142      145       +3     

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

Copy link
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

@hairyhenderson Thanks again for all your work on the OTEL part this is great and it helps me a LOT 👍

Sorry for this one, I should have think about this koanf weird way of managing complex object.
I'll merge this one and will release it in the next version.

Comment on lines +95 to +99
attribs map[string]string) (*resource.Resource, error) {
attrs := make([]attribute.KeyValue, 0, len(attribs))
for k, v := range attribs {
attrs = append(attrs, attribute.String(k, v))
}
Copy link
Owner

Choose a reason for hiding this comment

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

praise: This is a good catch, I think koanf is messing up things when it is a complex object. This is way better like this, thank you 🙏.

Copy link

sonarcloud bot commented Nov 4, 2024

@thomaspoignant thomaspoignant merged commit e5026ab into thomaspoignant:main Nov 4, 2024
20 of 22 checks passed
@hairyhenderson hairyhenderson deleted the otel-fix-resource-attribute-support-2607 branch November 6, 2024 14:32
@hairyhenderson
Copy link
Contributor Author

@thomaspoignant 👋 any chance of a patch release soon so I can get this fix rolled out? 🙇‍♂️

@thomaspoignant
Copy link
Owner

@hairyhenderson Yes I will release a version later this week.

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.

(bug) Tracing: resource attribute parsing is broken (wrong data type)
2 participants