logo
pub struct SdkProvidedResourceDetector;
Expand description

There are the attributes which MUST be provided by the SDK as specified in the Resource SDK specification. This detector detect those attributes and if the attribute cannot be detected, use the default value.

This detector will first try OTEL_SERVICE_NAME env. If it’s not available. Then it will check the OTEL_RESOURCE_ATTRIBUTES env and see if it contains service.name resource. If it’s also not available. Then it will use unknown_service.

Note that if service.name is empty. It will be ignore and the service name will be unknown_service. If users want to set an empty service name. They can provide a resource with empty value and service.name key.

Trait Implementations

Formats the value using the given formatter. Read more

detect returns an initialized Resource based on gathered information. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.