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

Warning Message Metrics exporter #106

Closed
volkerfrank opened this issue Sep 18, 2023 · 4 comments · Fixed by #112
Closed

Warning Message Metrics exporter #106

volkerfrank opened this issue Sep 18, 2023 · 4 comments · Fixed by #112

Comments

@volkerfrank
Copy link

Hi,
plugin works fine on my mule project.
I used the plugin to transfer the traces to Elastic with the otlp-exporter.
I use the version 1.2.1 of the mule-opentelemetry-module.
I understand that the plugin don't support metrics and logs.
But in my application I see the following warning:
WARN 2023-09-18 10:29:01,677 [OkHttp http://localhost:4317/...] [processor: ; event: ] io.opentelemetry.exporter.internal.grpc.GrpcExporter: Failed to export metrics. Server responded with gRPC status code 2. Error message: Failed to connect to localhost/127.0.0.1:4317
Can I supress this warning?
Here is my config of the plugin:

	<opentelemetry:config name="OpenTelemetry_Config" doc:name="OpenTelemetry Config" doc:id="56f3279a-19cf-4c0e-b435-018de8bcdf19"	serviceName="-------------------------------" spanAllProcessors="true">
		<opentelemetry:resource-attributes>
			<opentelemetry:attribute key="mule.env" value="${stage}" />
			<opentelemetry:attribute key="deployment.environment" value="${stage}" />
		</opentelemetry:resource-attributes>
		<opentelemetry:exporter>
			<opentelemetry:otlp-exporter collectorEndpoint="https://cd7d35fcaaa94eb1a5eef9c9e3200109.apm.westeurope.azure.elastic-cloud.com:443">
				<opentelemetry:headers>
					<opentelemetry:header key="Authorization" value="Bearer --------------------" />
				</opentelemetry:headers>
			</opentelemetry:otlp-exporter>
		</opentelemetry:exporter>
	</opentelemetry:config>
@manikmagar
Copy link
Contributor

Thank you @volkerfrank for reporting this. Metrics export is disabled by default so this shouldn't have happened. Can you test it with the 1.2.0 version of this module? Let me know please if that works as expected and this is a behavior with 1.2.1 only.

@volkerfrank
Copy link
Author

Hi, yes this warning only occur with version 1.2.1. With version 1.2.0 I don't have this warning.
I found the following:
Regarding this INFO message in version 1.2.1:
INFO 2023-09-18 13:08:36,948 [BatchSpanProcessor_WorkerThread-1] [processor: ; event: ] io.opentelemetry.api.GlobalOpenTelemetry: AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true
I enabled this JVM option. With this JVM option the warning occurs.
Solution is not to enable the JVM option otel.java.global-autoconfigure.enabled.

@manikmagar
Copy link
Contributor

Thanks for the confirmation @volkerfrank. That's what I guess must be happening here. Version 1.2.1 upgraded OTEL SDK version #101 which seems to have introduced that JVM flag behavior.

As the plugin explicitly initiates the SDK, it doesn't need that flag. Looks like internally OTEL SDK is still looking for that and when enabling that, somewhere it is triggering that metrics behavior. We will take a look at that. Was there any other reason for enabling that flag? Did you see anything else not working as expected if that is not enabled? If there weren't any other reasons, I suggest you don't add JVM flag and ignore that INFO message about the flag.

@Kirmito
Copy link

Kirmito commented Sep 29, 2023

Hi, I was referencing version 1.0.0 and I got the same INFO message, it's interesting because it appears sometimes:

11:19:48.030 [BatchSpanProcessor_WorkerThread-1] INFO io.opentelemetry.api.GlobalOpenTelemetry correlationId= trace_id= span_id= trace_flags= - AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true

Then, I tested each version and I got the same INFO message on each version. However, everything is working as expected!

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

Successfully merging a pull request may close this issue.

3 participants