Skip to content
Merged
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{})
Comment thread
dashpole marked this conversation as resolved.
Outdated
}

// WithServiceName adds an attribute with the name of the service to the configured Resource.
func WithServiceName() Option {
Comment thread
codeboten marked this conversation as resolved.
Outdated
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