OpenTelemetry Python - Resource Detector for Containers

class opentelemetry.resource.detector.containerid.ContainerResourceDetector(raise_on_error=False)[source]

Bases: ResourceDetector

Detects container.id only available when app is running inside the docker container and return it in a Resource

detect()[source]

Don’t call Resource.create here to avoid an infinite loop, instead instantiate Resource directly

Return type:

Resource