Skip to content

CAMEL-23312: Add SpanKind support to OpenTelemetry2 component #22610

Closed
JiriOndrusek wants to merge 1 commit intoapache:mainfrom
JiriOndrusek:CAMEL-23312-add-spankind-to-telemetry-api-03
Closed

CAMEL-23312: Add SpanKind support to OpenTelemetry2 component #22610
JiriOndrusek wants to merge 1 commit intoapache:mainfrom
JiriOndrusek:CAMEL-23312-add-spankind-to-telemetry-api-03

Conversation

@JiriOndrusek
Copy link
Copy Markdown
Contributor

fixes https://issues.apache.org/jira/browse/CAMEL-23312
superseeds #22577

Adds OpenTelemetry SpanKind support to camel-opentelemetry2 component:

  • Introduced OpenTelemetryHttpSpanDecorator and OpenTelemetryMessagingSpanDecorator interfaces defining SpanKind for EVENT_SENT/EVENT_RECEIVED operations
  • Modified OpenTelemetryTracer to pass decorator context via ThreadLocal without changing SpanLifecycleManager API
  • All concrete decorators extend camel-telemetry decorators (inherit component-specific behavior like Kafka tags) and implement OpenTelemetry interfaces (add SpanKind)
  • HTTP components use CLIENT/SERVER, messaging components use PRODUCER/CONSUMER, others default to INTERNAL

Description

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@JiriOndrusek JiriOndrusek requested a review from squakez April 14, 2026 11:37
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@JiriOndrusek
Copy link
Copy Markdown
Contributor Author

JiriOndrusek commented Apr 14, 2026

@squakez I hope that I followed all your suggestions in #22577 and comments in https://issues.apache.org/jira/browse/CAMEL-23312

The amount of changes is bigger as I needed to get the spankind during OpenTelemetryTracer#beginProcessorSpan and OpenTelemetryTracer#beginEventSpan

@JiriOndrusek
Copy link
Copy Markdown
Contributor Author

I now see that i can refactor and simplify the change a lot. I'll reopen the PR with the proper change.

@squakez
Copy link
Copy Markdown
Contributor

squakez commented Apr 14, 2026

I think you just need to change the Abstract decorator classes in the camel-telemetry component. You can add there the "kind" tag with the value it is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants