Closed vijaybtech13 closed 43 minutes ago
https://github.com/paketo-buildpacks/opentelemetry?tab=readme-ov-file#behavior reads By default, the metrics exporting feature of the agent is configured to be disabled (OTEL_METRICS_EXPORTER=none).
Paketo build pack uses environment variable to disable the metrics exporter. Environment variables have a higher precedence than the configuration file.
@laurit - Thanks for the information. It helps. Now understood, why otel.metrics.exporter was not applied, while passing it through configuration file.
Describe the bug
metricReaders object was not auto configured when passing otel.metrics.exporter property through configuration file(otel.properties). Since metricReaders was not configured metrics generation and export did not happen.
However, while passing as environment variable (OTEL_METRICS_EXPORTER=otlp) solved this issue. Why was the config file approach not worked?
java-agent-auto-configuration-log.txt
Steps to reproduce
Expected behavior
metricReaders should be auto configured. Metrics should be generated and exported to configured collector.
Auto configured metricReaders [ expected ]
metricReaders=[PeriodicMetricReader{exporter=OtlpGrpcMetricExporter{exporterName=otlp, type=metric, endpoint=https://collector:4317, endpointPath=/opentelemetry.proto.collector.metrics.v1.MetricsService/Export, timeoutNanos=10000000000, connectTimeoutNanos=10000000000, compressorEncoding=null, headers=Headers{User-Agent=OBFUSCATED}
Actual behavior
metricReaders was not auto configured by java-agent. Metrics were not generated and exported to configured collector.
Auto configured metricReaders [ actual ] metricReaders=[]
Javaagent or library instrumentation version
opentelemetry-java-instrumentation/releases/tag/v2.9.0
Environment
JDK: process.runtime.description="BellSoft OpenJDK 64-Bit Server VM 17.0.13+12-LTS", process.runtime.name="OpenJDK Runtime Environment", process.runtime.version="17.0.13+12-LTS",
OS: os.description="Linux 5.15.0-1066-aws", os.type="linux",
Spring boot: 3.3.2
Additional context
What is expected from this bug?