Version: 7.17 (per local docker-compose Quick start development environment | APM User Guide [7.17] | Elastic)
Is there anything special in your setup? We were originally using the micrometer-tracing-brave-bridge and exporting spans to Zipkin and are now trying to move from OpenTracing to OpenTelemetry using the Elastic Agent. In the original setup, we updated the logback.xml pattern with %black(%date{ISO8601}) %highlight(%-5level) [%blue(%X{traceId:-}) %magenta(%X{spanId:-})] %yellow(%C{1}): %msg%n%throwable
and trace/span ids were shown and propagated correctly across services.
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
After changing the micrometer dependencies to otel and running the application in IntelliJ with the VM option with the elastic-apm 1.42.0 java agent, and updating logback from traceId to trace.id && spanId to transaction.id, none of the ids are being displayed in the Console. The requests can be seen in Kibana Observability, and the trace ids show up across services. Also, the transactions do not display the waterfall from service to service. I'm not sure what the problem is.
I came across this (Get started | ECS Logging Java Reference [1.x] | Elastic) and added the logging dependency, but it doesn't seem to help.
Any ideas on what to do to get the trace.id and transaction.id to display in the console and propagate correctly across services (as well as have the waterfall show all the services correctly)?
Provide logs and/or server output (if relevant):
Relevant sections of effective pom:
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-otel</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<version>1.25.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.5.0</version>
<scope>compile</scope>
</dependency>
Relevant sections of application.yml
management:
tracing:
sampling:
probability: 1.0
propagation:
type: w3c
enabled: true
baggage:
enabled: true
metrics:
distribution:
percentiles-histogram:
http:
server:
requests: true
endpoints:
web:
exposure:
include:
- "prometheus"
- "refresh"
otlp:
tracing:
endpoint: http://localhost:8200
Relevant sections of elasticapm.properties
application_packages=com.example
server_urls=http://localhost:8200
environment=development
log_ecs_reformatting=SHADE
log_level=INFO
capture_body=transactions
capture_headers=true
transaction_ignore_user_agents=kube-probe,GoogleHC
use_path_as_transaction_name=true