Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context Propagation for ActiveJ Applications Using OpenTelemetry Java Agent Instrumentation #13202

Open
kcsurapaneni opened this issue Feb 4, 2025 · 1 comment · May be fixed by #13335
Open
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request new instrumentation

Comments

@kcsurapaneni
Copy link

kcsurapaneni commented Feb 4, 2025

Is your feature request related to a problem? Please describe.

Description

I am experiencing issues with context propagation when using the OpenTelemetry Java agent with ActiveJ applications. The context does not seem to propagate automatically, leading to broken traces or missing spans. I suspect this might be due to ActiveJ's custom threading model or lack of built-in instrumentation support.

Steps to Reproduce

  1. Set up an ActiveJ application.
  2. Attach the OpenTelemetry Java agent to the application.
  3. Configure the agent to export traces to a backend (e.g., HyperDX).
  4. Execute a workflow in the ActiveJ application that involves an API call.
  5. Observe that the context is not propagated, resulting in incomplete traces.

Expected Behavior

The OpenTelemetry Java agent should automatically propagate context across threads and components in ActiveJ applications, ensuring that traces are complete and spans are correctly linked.

Actual Behavior

The context is lost when operations are executed in ActiveJ's custom thread pools or event loops. This results in broken traces and missing spans.

Environment

  • opentelemetry-javaagent - version: 2.12.0
  • ActiveJ Version: 6.0-rc1
  • Java Version: JDK 17
  • Agent Configuration:
    /usr/bin/java 
    -javaagent:/path/to/opentelemetry-javaagent.jar \
    -Dotel.service.name=my-activej-app \
    -Dotel.exporter=otlp \
    -Dotel.exporter.otlp.protocol=http/protobuf \
    -Dotel.exporter.otlp.endpoint=https://in-otel.hyperdx.io \
  • Other Dependencies:
    We are using Slf4J with Logback, and have already added the following dependencies:

Describe the solution you'd like

The OpenTelemetry Java agent should automatically propagate context across threads and components in ActiveJ applications, ensuring that traces are complete and spans are correctly linked.

Describe alternatives you've considered

No response

Additional context

No response

@kcsurapaneni kcsurapaneni added enhancement New feature or request needs triage New issue that requires triage labels Feb 4, 2025
@laurit
Copy link
Contributor

laurit commented Feb 5, 2025

We'd welcome a contribution for this.

We are using Slf4J with Logback, and have already added the following dependencies:
logback-mdc-1.0
logback-appender-1.0

These are included in the agent, you don't need to add them to your application.

@laurit laurit added contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome new instrumentation and removed needs triage New issue that requires triage labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request new instrumentation
Projects
None yet
2 participants