Skip to content

Commit

Permalink
WithContainerID: Document ECS limitation. (#3639)
Browse files Browse the repository at this point in the history
* WithContainerID: Document ECS limitation.

WithContainerID is not able to extract the correct container id in an ECS environment. The ECS resource detector should be used instead (https://pkg.go.dev/go.opentelemetry.io/contrib/detectors/aws/ecs).
See #3633.

* fix lint

* Update sdk/resource/config.go

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
mackjmr and MrAlias committed Feb 9, 2023
1 parent d5fca83 commit e9bdda0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/resource/config.go
Expand Up @@ -194,6 +194,8 @@ func WithContainer() Option {
}

// WithContainerID adds an attribute with the id of the container to the configured Resource.
// Note: WithContainerID will not extract the correct container ID in an ECS environment.
// Please use the ECS resource detector instead (https://pkg.go.dev/go.opentelemetry.io/contrib/detectors/aws/ecs).
func WithContainerID() Option {
return WithDetectors(cgroupContainerIDDetector{})
}

0 comments on commit e9bdda0

Please sign in to comment.