elastic / elastic-otel-java

Apache License 2.0
8 stars 7 forks source link

0.4.0 inferred spans extension not cooperating with vanilla agent #289

Open jackshirazi opened 3 weeks ago

jackshirazi commented 3 weeks ago

If the inferred spans extension is loaded in to the vanilla agent, it runs but the exporter seems to fail to export correctly. Note that the 0.4.0 agent works fine, and the inferred spans extension with vanilla also works, it seems to be export that is problematic.

The error message at debug is not great.

[otel.javaagent 2024-06-11 17:36:43:642 +0000] [elastic-inferred-spans] INFO io.opentelemetry.exporter.logging.LoggingSpanExporter - 'Testing#methodD' : b51bbe90523807bfd39b5dd8c2fa5fd4 7962d9533b5a8bf1 INTERNAL [tracer: elastic-inferred-spans:0.4.0] AttributesMap{data={code.stacktrace=at test.Testing.methodC(Testing.java), thread.id=30, elastic.span.local_root.id=0000000000000000, thread.name=elastic-inferred-spans, elastic.span.is_local_root=false, elastic.is_inferred=true}, capacity=128, totalAddedValues=6}
[otel.javaagent 2024-06-11 17:36:43:642 +0000] [elastic-inferred-spans] DEBUG co.elastic.otel.profiler.SamplingProfiler - Created spans (2) for thread 38
[otel.javaagent 2024-06-11 17:36:43:642 +0000] [elastic-inferred-spans] DEBUG co.elastic.otel.profiler.SamplingProfiler - Processing traces took 9,486us
[otel.javaagent 2024-06-11 17:36:43:642 +0000] [elastic-inferred-spans] DEBUG co.elastic.otel.profiler.SamplingProfiler - End profiling session
[otel.javaagent 2024-06-11 17:36:43:643 +0000] [elastic-inferred-spans] DEBUG co.elastic.otel.profiler.SamplingProfiler - Start full profiling session (async-profiler and agent processing)
[otel.javaagent 2024-06-11 17:36:43:644 +0000] [elastic-inferred-spans] DEBUG co.elastic.otel.profiler.SamplingProfiler - Profiling started

[otel.javaagent 2024-06-11 17:36:43:708 +0000] [OkHttp https://f52b312dad5a47c4afd55d699770d64a.apm.us-central1.gcp.cloud.es.io/...] WARN io.opentelemetry.exporter.internal.http.HttpExporter - Failed to export spans. Server responded with HTTP status code 401. Error message: Unable to parse response body, HTTP status message:
[otel.javaagent 2024-06-11 17:36:43:708 +0000] [BatchSpanProcessor_WorkerThread-1] DEBUG io.opentelemetry.sdk.trace.export.BatchSpanProcessor - Exporter failed

I tried running the extension on both the 2.3.0 and 2.4.0 vanilla agent, same error

JonasKunz commented 2 days ago

I just tried it with the vanilla agent 2.4.0 and the 0.4.0 extension, works without problems for me. Do you maybe have a docker-setup to reproduce the issue?