This example demonstrates how to use declarative configuration to configure the OpenTelemetry SDK using a YAML configuration file as defined in opentelemetry-configuration.
The configuration file is located at otel-sdk-config.yaml.
- Java 1.8
export OTEL_EXPERIMENTAL_CONFIG_FILE=$(pwd)/otel-sdk-config.yaml
../gradlew run
Observe how data is printed to the console as configured in otel-sdk-config.yaml.
For use with the OpenTelemetry Java, see Java Agent declarative configuration.