grafana / grafana/otel-profiling-java

opentelemetry-samplers jar (used for adding sdk config yml file) not working with otel-profiling-java jar when set as env variable

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
53
Forks
10
Avg merge
4d 9h
Merged PRs (30d)
4

Description

Issue : When attempting to use both the otel-profiling JAR (for trace-to-profiling linking) and the opentelemetry-samplers JAR (specified via OTEL_JAVAAGENT_EXTENSIONS env variable), the Opentelemetry Java Agent does not handle them together.

- If only otel-profiling jar is set as an environment variable, profiling and linking work correctly.
- If both the otel-profiling jar as env variable as well as opentelemetry-samplers jar as jvm arg ( -Dotel.javaagent.extensions ) are set then the trace-to-profiling linking stops working, but the SDK configuration is correctly applied.

Additionally, the sdk-config.yaml does not seem to support any other jar when provided as an environment variable.

1. **Working configuration (Only otel-profiling jar enabled using env variable)**

export OTEL_JAVAAGENT_EXTENSIONS="/path to otel-profiling jar"
jar -javaagent:"/path to opentelemetry-javagent jar" -jar myapp.jar

This configuration enables the extension and the trace to profile linking is seen.

2. **Samplers and Otel-profiling jar added**

export OTEL_JAVAAGENT_EXTENSIONS="/path to otel-profiling jar"
jar -javaagent:"/path to opentelemetry-javaagent jar" -Dotel.javaagent.extensions="/path to opentelemetry-samplers jar" -Dotel.experimental.config.file="/path to sdk -config yml file"

This configuration works fine for sdk config but the trace to profile linking does not seem to work.

**Expected behavior :**

- Both the otel-profiling and opentelemetry-samplers jars should work together without disabling the trace-to-profile linking.
- sdk-config.yaml should support otel-profiling jar when set via environment variable.

Is there a recommended way to configure both profiling and sdk extensions together ?

I would really appreciate any guidance on resolving this issue. Thank you for the insights.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.