Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sdk/resource/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,22 @@ func WithContainer() Option {
func WithContainerID() Option {
return WithDetectors(cgroupContainerIDDetector{})
}

// WithServiceID adds an attribute with the uid of the service to the configured Resource.
func WithServiceID() Option {
return WithDetectors(defaultServiceInstanceIDDetector{})
}

// WithServiceName adds an attribute with the name of the service to the configured Resource.
func WithServiceName() Option {
return WithDetectors(defaultServiceNameDetector{})
}

// WithService adds all the Service attributes to the configured Resource.
// See individual WithService* functions to configure specific attributes.
func WithService() Option {
return WithDetectors(
defaultServiceInstanceIDDetector{},
defaultServiceNameDetector{},
)
}
Loading