io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-sdk-extension-autoconfigure Show documentation
Show all versions of opentelemetry-sdk-extension-autoconfigure Show documentation
OpenTelemetry SDK Auto-configuration
The newest version!
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.sdk.autoconfigure.internal;
import io.opentelemetry.sdk.autoconfigure.ResourceConfiguration;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
import io.opentelemetry.sdk.resources.Resource;
/**
* {@link ResourceProvider} for automatically configuring {@link
* ResourceConfiguration#createEnvironmentResource(ConfigProperties)}.
*
* This class is internal and is hence not for public use. Its APIs are unstable and can change
* at any time.
*/
public final class EnvironmentResourceProvider implements ResourceProvider {
@Override
public Resource createResource(ConfigProperties config) {
return ResourceConfiguration.createEnvironmentResource(config);
}
@Override
public int order() {
// Environment resource takes precedent over all other ResourceProviders except
// ServiceInstanceIdResourceProvider.
return Integer.MAX_VALUE - 1;
}
}