Opentelemetry: reactive message incoming channel has no attributes #45375
Open
Description
Describe the bug
Spans generated for a method annotated with @Incoming(...) @WithSpan(...) ...
have on attributes.
Expected behavior
Spans have general attributes like code.namespace
.
Actual behavior
Spans have no attributes.
How to Reproduce?
Reproducer:
- Clone https://github.com/turing85/quarkus-opentelemetry, branch
feature/switch-to-lgtm
:
$ git clone --branch feature/switch-to-lgtm https://github.com/turing85/quarkus-opentelemetry.git \
&& cd quarkus-opentelemetry
- Start
lgtm
and wait untillgtm
is fully started, i.e. until the contaier logs show:
$ docker-compose --file local-deployment/docker-compose.yml up --detach &&
docker logs -f quarkus-opentelemetry-lgtm-1
...
The OpenTelemetry collector and the Grafana LGTM stack are up and running. (created /tmp/ready)
Open ports:
- 4317: OpenTelemetry GRPC endpoint
- 4318: OpenTelemetry HTTP endpoint
- 3000: Grafana. User: admin, password: admin
2.1. While you are waiting, take a look at class Receiver.java
, which holds the relevant code:
...
@ApplicationScoped
@Log4j2
public class Receiver {
@Incoming("numbers")
@WithSpan("numbers-receive")
public CompletionStage<Void> data(Message<Number> message) {
// @formatter:off
log.info(
"received a {} message for {}",
message
.getMetadata(SubscribeMessageMetadata.class)
.map(SubscribeMessageMetadata::subject)
.orElse("<none>"),
message.getPayload());
// @formatter:on
return message.ack();
}
}
- start the ping-service, wait for the service to be fully started:
$ ./mvnw --projects ping quarkus:dev
- In another terminal, start the pong-service, wait for the service to be fully started:
$ ./mvnw --projects pong quarkus:dev
- Generate some requests, cancel the script after a few runs with CRTL + C:
$ scripts/generate-load.sh
- Look at the traces in Grafana. Grafana is reachable at http://localhost:3000
Output of uname -a
or ver
Linux xxx 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
Quarkus version or git rev
3.17.5
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /home/marco/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1
Java version: 21.0.3, vendor: Eclipse Adoptium, runtime: /opt/java/mandrel/23.1.3.1-java21
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.8.0-51-generic", arch: "amd64", family: "unix"
Additional information
No response
Metadata
Assignees
Labels
Type
Projects
Status
Todo
Activity