Class EnvironmentResourceContributor

java.lang.Object
io.arconia.opentelemetry.autoconfigure.resource.contributor.EnvironmentResourceContributor
All Implemented Interfaces:
ResourceContributor

@Incubating(since="0.5.0") public final class EnvironmentResourceContributor extends Object implements ResourceContributor
A ResourceContributor that contributes attributes from the Spring environment and configuration properties, following the OpenTelemetry Semantic Conventions.

The following attributes are populated:

  • service.name
  • service.namespace
  • service.instance.id
  • webengine.name
  • webengine.version

Furthermore, any additional attributes defined in the OpenTelemetryResourceProperties are also populated.

  • Field Details

    • SERVICE_INSTANCE_ID

      public static final io.opentelemetry.api.common.AttributeKey<String> SERVICE_INSTANCE_ID
    • SERVICE_NAMESPACE

      public static final io.opentelemetry.api.common.AttributeKey<String> SERVICE_NAMESPACE
    • WEBENGINE_NAME

      public static final io.opentelemetry.api.common.AttributeKey<String> WEBENGINE_NAME
    • WEBENGINE_VERSION

      public static final io.opentelemetry.api.common.AttributeKey<String> WEBENGINE_VERSION
  • Constructor Details

    • EnvironmentResourceContributor

      public EnvironmentResourceContributor(org.springframework.core.env.Environment environment, OpenTelemetryResourceProperties properties)
  • Method Details

    • contribute

      public void contribute(io.opentelemetry.sdk.resources.ResourceBuilder builder)
      Specified by:
      contribute in interface ResourceContributor