apache / apache/camel-quarkus

camel-quarkus-opentelemetry @WithSpan context missing

Open
#4,796 3 comments 0 reactions 0 assignees View on GitHub
area/opentelemetry bug
Dominant language
Java
Stars
302
Forks
232
Avg merge
1d 20h
Merged PRs (30d)
114

Description

Camel Quarkus: 2.13.x

It seems that the trace context is being kept only if the trace is being initiated by an http request.

Given the following bean:
```java
@ApplicationScoped
@Named("telemetryBean")
public class TelemetryBean {

@WithSpan
public String span(String source) {
System.out.println(source);
return source;
}
}
```

And the following route builder:
```java
@Override
public void configure() throws Exception {
from("platform-http:/test")
.bean("telemetryBean","span('http')");

from("timer:timer?period=5000")
.bean("telemetryBean","span('test')");
}
```

This are the collected traces:
![image](https://user-images.githubusercontent.com/5019896/232737389-6407ae7b-2c2c-40d0-ba17-18e2bcd8ab39.png)

The first one contains 2 spans correctly related:
![image](https://user-images.githubusercontent.com/5019896/232737619-c91397a0-3bb5-44da-b195-86692bac8b2f.png)

While the second and the third traces contains two unrelated spans that should be instead related each other

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue from the TelemetryBean and the route builder's HTTP and timer routes, then compare the collected traces for each trigger. Investigate the Camel Quarkus OpenTelemetry integration around @WithSpan context propagation. Done means the timer-triggered spans are related to each other as the HTTP-triggered spans are.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.