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

UP integration not happy on Windows in 0.4.0 #299

Closed
jackshirazi opened this issue Jun 26, 2024 · 1 comment · Fixed by #313
Closed

UP integration not happy on Windows in 0.4.0 #299

jackshirazi opened this issue Jun 26, 2024 · 1 comment · Fixed by #313

Comments

@jackshirazi
Copy link
Contributor

Describe the bug

Agent seems to work, but has a nasty java.lang.IllegalStateException: Agent could not be initialized message

Steps to reproduce

Run the agent 0.4.0 on windows. Workaround is to disable it, eg -Delastic.otel.universal.profiling.integration.enabled=false

Expected behavior

No nasty error

Debug logs

Click to expand
[otel.javaagent 2024-06-26 16:42:37:310 +0100] [main] ERROR co.elastic.otel.JvmtiAccess - Failed to load jvmti native library
java.lang.IllegalStateException: Native agent does not work on windows 10
	at co.elastic.otel.JvmtiAccess.loadNativeLibrary(JvmtiAccess.java:153)
	at co.elastic.otel.JvmtiAccess.doInit(JvmtiAccess.java:93)
	at co.elastic.otel.JvmtiAccess.ensureInitialized(JvmtiAccess.java:82)
	at co.elastic.otel.JvmtiAccess.startProfilerReturnChannelSocket(JvmtiAccess.java:60)
	at co.elastic.otel.UniversalProfilingCorrelation.startProfilerReturnChannel(UniversalProfilingCorrelation.java:108)
	at co.elastic.otel.UniversalProfilingProcessor.openProfilerSocket(UniversalProfilingProcessor.java:160)
	at co.elastic.otel.UniversalProfilingProcessor.<init>(UniversalProfilingProcessor.java:123)
	at co.elastic.otel.UniversalProfilingProcessorBuilder.build(UniversalProfilingProcessorBuilder.java:43)
	at co.elastic.otel.UniversalProfilingProcessorAutoConfig.lambda$registerSpanProcessors$0(UniversalProfilingProcessorAutoConfig.java:79)
	at co.elastic.otel.common.ChainingSpanProcessorsInstaller.createProcessorChain(ChainingSpanProcessorsInstaller.java:88)
	at co.elastic.otel.common.ChainingSpanProcessorsInstaller.lambda$customize$0(ChainingSpanProcessorsInstaller.java:53)
	at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.lambda$mergeCustomizer$13(AutoConfiguredOpenTelemetrySdkBuilder.java:637)
	at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:64)
	at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:464)
	at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installOpenTelemetrySdk(OpenTelemetryInstaller.java:29)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:122)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:102)
	at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:99)
	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 co.elastic.otel.agent.ElasticAgent.premain(ElasticAgent.java:29)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
[otel.javaagent 2024-06-26 16:42:37:311 +0100] [main] ERROR co.elastic.otel.UniversalProfilingProcessorAutoConfig - Failed to initialize universal profiling integration, the feature won't work
java.lang.IllegalStateException: Agent could not be initialized
	at co.elastic.otel.JvmtiAccess.ensureInitialized(JvmtiAccess.java:85)
	at co.elastic.otel.JvmtiAccess.startProfilerReturnChannelSocket(JvmtiAccess.java:60)
	at co.elastic.otel.UniversalProfilingCorrelation.startProfilerReturnChannel(UniversalProfilingCorrelation.java:108)
	at co.elastic.otel.UniversalProfilingProcessor.openProfilerSocket(UniversalProfilingProcessor.java:160)
	at co.elastic.otel.UniversalProfilingProcessor.<init>(UniversalProfilingProcessor.java:123)
	at co.elastic.otel.UniversalProfilingProcessorBuilder.build(UniversalProfilingProcessorBuilder.java:43)
	at co.elastic.otel.UniversalProfilingProcessorAutoConfig.lambda$registerSpanProcessors$0(UniversalProfilingProcessorAutoConfig.java:79)
	at co.elastic.otel.common.ChainingSpanProcessorsInstaller.createProcessorChain(ChainingSpanProcessorsInstaller.java:88)
	at co.elastic.otel.common.ChainingSpanProcessorsInstaller.lambda$customize$0(ChainingSpanProcessorsInstaller.java:53)
	at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.lambda$mergeCustomizer$13(AutoConfiguredOpenTelemetrySdkBuilder.java:637)
	at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:64)
	at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:464)
	at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installOpenTelemetrySdk(OpenTelemetryInstaller.java:29)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:122)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:102)
	at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:99)
	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 co.elastic.otel.agent.ElasticAgent.premain(ElasticAgent.java:29)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)

@JonasKunz
Copy link
Contributor

The autoconfig will try to start the correlation on default settings, independent of whether the OS is supported or not. We should not do this and instead add pre-checks.

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