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

Add support for OpenTelemetry Java Agent #1

Open
Rperry2174 opened this issue Aug 23, 2022 · 2 comments
Open

Add support for OpenTelemetry Java Agent #1

Rperry2174 opened this issue Aug 23, 2022 · 2 comments

Comments

@Rperry2174
Copy link
Contributor

Currently we support use cases where tracing is manually configured, but still using OpenTelemetry. However, for some they are instead using the auto-instrumentation provided by the open-telemetry-java-instrumentation package.

We should support this as well!

More details to be added after doing more research.

@dariusj1
Copy link

yeah, this doesn't seem to be working.

Defaulted container "app" out of: app, jwt-keys (init), pyroscope-instrumentation-java (init), opentelemetry-auto-instrumentation-java (init)                                                                                                                                                                                 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/pyroscope-instrumentation-java/pyroscope.jar -javaagent:/otel-auto-instrumentation-java/javaagent.jar                                                                                                                                                                                
2024-07-30 13:41:31.162 [DEBUG] Config: Config{agentEnabled=true, applicationName='auth-depl', profilingInterval=PT0.01S, profilingEvent=ITIMER, profilingAlloc='', profilingLock='', samplingEventOrder='null', uploadInterval=PT10S, javaStackDepthMax=2048, logLevel=INFO, serverAddress='http://pyroscope.monitoring.svc:4
040', authToken='null', timeseriesName='auth-depl', timeseries=auth-depl, format=JFR, pushQueueCapacity=8, labels={}, ingestMaxTries=8, compressionLevelJFR=1, compressionLevelLabels=1, allocLive=false, httpHeaders={}, samplingDuration=null, tenantID=null}                                                               
2024-07-30 13:41:31.963 [INFO] Profiling started                                                                                                                                                                                                                                                                              
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended                                                                                                                                                                                             
[otel.javaagent 2024-07-30 13:41:32:125 +0000] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.32.1                                                                                                                                                                       
OpenTelemetry Javaagent failed to start                                                                                                                                                                                                                                                                                       
java.lang.UnsatisfiedLinkError: Native Library /tmp/?-pyroscope/libasyncProfiler-linux-musl-x64-70e751fa84d39dcf2daa802a20d7378ca9c8f2.so already loaded in another classloader                                                                                                                                               
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:196)                                                                                                                                                                                                                                
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)                                                                                                                                                                                                                                
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2383)                                                                                                                                                                                                                                                 
        at java.base/java.lang.Runtime.load0(Runtime.java:746)                                                                                                                                                                                                                                                                
        at java.base/java.lang.System.load(System.java:1857)                                                                                                                                                                                                                                                                  
        at io.otel.pyroscope.shadow.one.profiler.AsyncProfiler.getInstance(AsyncProfiler.java:36)                                                                                                                                                                                                                             
        at io.otel.pyroscope.shadow.labels.io.pyroscope.PyroscopeAsyncProfiler.getAsyncProfiler(PyroscopeAsyncProfiler.java:32)                                                                                                                                                                                               
        at io.otel.pyroscope.shadow.javaagent.Profiler.<init>(Profiler.java:27)                                                                                                                                                                                                                                               
        at io.otel.pyroscope.shadow.javaagent.PyroscopeAgent$Options$Builder.<init>(PyroscopeAgent.java:85)                                                                                                                                                                                                                   
        at io.otel.pyroscope.shadow.javaagent.PyroscopeAgent.start(PyroscopeAgent.java:33)                                                                                                                                                                                                                                    
        at io.otel.pyroscope.PyroscopeOtelAutoConfigurationCustomizerProvider.lambda$customize$0(PyroscopeOtelAutoConfigurationCustomizerProvider.java:28)                                                                                                                                                                    
        at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.lambda$mergeCustomizer$12(AutoConfiguredOpenTelemetrySdkBuilder.java:585)                                                                                                                                                                 
        at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:425)                                                                                                                                                                                     
        at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installOpenTelemetrySdk(OpenTelemetryInstaller.java:34)                                                                                                                                                                                                  
        at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:123)                                                                                                                                                                                                                   
        at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:103)                                                                                                                                                                                                                   
        at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:98)                                                                                                                                                                                                                                
        at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(AgentInitializer.java:53)                                                                                                                                                                                                                              
        at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(AgentInitializer.java:47)                                                                                                                                                                                                                              
        at io.opentelemetry.javaagent.bootstrap.AgentInitializer.execute(AgentInitializer.java:64)                                                                                                                                                                                                                            
        at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:46)                                                                                                                                                                                                                         
        at io.opentelemetry.javaagent.OpenTelemetryAgent.startAgent(OpenTelemetryAgent.java:57)
        at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:45)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:490)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:502)
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts

My app is auto-instrumented with a javaagent. I tried to add profile correlation with traces and I got this exception on app startup ↑↑.

I guess this is what's meant by "We should support this as well!"?

@eric-engberg
Copy link

This is very old, is it being worked on? I just tried setting this up. I followed the docs but getting this error for some reason. There's no extra config for otel or pryoscope in our javacode. Just load the java agents and configure via environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants