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

Service resource detector #5424

Closed

Conversation

pyohannes
Copy link
Contributor

Fixes #5423

This PR adds a resource detector for detecting service.instance.id which sets its values according to to experimental semantic conventions for service attributes:

  • service.instance.id

@pyohannes pyohannes requested a review from a team April 23, 2024 14:16
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 62.3%. Comparing base (fed6e67) to head (47bf1d7).

❗ Current head 47bf1d7 differs from pull request most recent head 5b584d7. Consider uploading reports for the commit 5b584d7 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5424   +/-   ##
=====================================
  Coverage   62.3%   62.3%           
=====================================
  Files        189     190    +1     
  Lines      11575   11584    +9     
=====================================
+ Hits        7219    7226    +7     
- Misses      4146    4147    +1     
- Partials     210     211    +1     
Files Coverage Δ
detectors/service/service.go 77.7% <77.7%> (ø)

}
}

matched, err := regexp.MatchString("^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$", uuid)

Choose a reason for hiding this comment

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

tip for the future: you can add /i at the end of the regex to make it case insensitive, this way you don't need to add A-F and a-f, which have the risk of forgetting one of them

@pyohannes
Copy link
Contributor Author

Closing in favor of open-telemetry/opentelemetry-go#5520.

@pyohannes pyohannes closed this Jun 20, 2024
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.

Add a resource detector that sets a default value for service.instance.id according to semantic conventions
2 participants