Skip to content

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

Description

@VidhiPhatnani

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.

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions