
io.opentelemetry.javaagent.tooling.DistroVersionResourceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-javaagent-tooling Show documentation
Show all versions of opentelemetry-javaagent-tooling Show documentation
Instrumentation of Java libraries using OpenTelemetry.
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.javaagent.tooling;
import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_NAME;
import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_VERSION;
import com.google.auto.service.AutoService;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
import io.opentelemetry.sdk.resources.Resource;
@AutoService(ResourceProvider.class)
public class DistroVersionResourceProvider implements ResourceProvider {
@Override
public Resource createResource(ConfigProperties config) {
return AgentVersion.VERSION == null
? Resource.empty()
: Resource.create(
Attributes.of(
TELEMETRY_DISTRO_NAME,
"opentelemetry-java-instrumentation",
TELEMETRY_DISTRO_VERSION,
AgentVersion.VERSION));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy