Module opentelemetry::sdk::resource[][src]

Expand description

Resource

A Resource is an immutable representation of the entity producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace, and possibly is part of a Deployment which also has a name. All three of these attributes can be included in the Resource.

The primary purpose of resources as a first-class concept in the SDK is decoupling of discovery of resource information from exporters. This allows for independent development and easy customization for users that need to integrate with closed source environments. When used with distributed tracing, a resource can be associated with the TracerProvider when it is created. That association cannot be changed later. When associated with a TracerProvider, all Spans produced by any Tracer from the provider are associated with this Resource.

Resource detectors

ResourceDetectors are used to detect resource from runtime or environmental variables. The following ResourceDetectors are provided along with this SDK.

  • EnvResourceDetector, detect resource from environmental variables.
  • OsResourceDetector, detect OS from runtime.
  • ProcessResourceDetector, detect process information

Structs

EnvResourceDetector

Resource detector implements ResourceDetector and is used to extract general SDK configuration from environment.

IntoIter

An owned iterator over the entries of a Resource.

Iter

An iterator over the entries of a Resource.

OsResourceDetector

Detect runtime operating system information.

ProcessResourceDetector

Detect process information.

Resource

Describes an entity about which identifying information and metadata is exposed.

Traits

ResourceDetector

ResourceDetector detects OpenTelemetry resource information