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

Add Container ID to resource if available #3374

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Aug 8, 2024

Use the resource.WithContainer option to include all available information about the container an application is running in. If a container is not running in a container, this is will not add any attributes and will not alter the existing resource definitions.

This does not add tests due to the challenge in mocking a container runtime environment. It relies on the upstream OTel testing of the WithContainer options instead.

Fix #3355

Use the `resource.WithContainer` option to include all available
information about the container an application is running in. If a
container is not running in a container, this is will not add any
attributes and will not alter the existing resource definitions.

Fix signalfx#3355
@MrAlias MrAlias requested review from a team as code owners August 8, 2024 18:05
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.99%. Comparing base (278333a) to head (77b4433).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3374   +/-   ##
=======================================
  Coverage   78.98%   78.99%           
=======================================
  Files          88       88           
  Lines        3403     3404    +1     
=======================================
+ Hits         2688     2689    +1     
  Misses        641      641           
  Partials       74       74           
Flag Coverage Δ
Linux 80.05% <100.00%> (+<0.01%) ⬆️
Windows 75.23% <100.00%> (+<0.01%) ⬆️
macOS 76.08% <100.00%> (+<0.01%) ⬆️

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

@pellared pellared left a comment

Choose a reason for hiding this comment

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

How about adding to changelog something like

### Added

- Add container attributes to resource if available. (#3374)

@MrAlias MrAlias requested a review from a team as a code owner August 9, 2024 14:09
@pellared pellared merged commit 368b848 into signalfx:main Sep 2, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add container ID to resource if running in a detectable environment
3 participants