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

Micrometer to OpenTelemetry Bridge #43831

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brunobat
Copy link
Contributor

@brunobat brunobat commented Oct 11, 2024

solves #43621

The implementation uses the opentelemetry-micrometer-1.5 library.

This allows us to create a Micrometer registry implemented with the OpenTelemetry SDK and APIs.

All telemetry data created with both Micrometer and OpenTelemetry will be processed by the same OpenTelemetry SDK instance from the quarkus-opentelemetry extension and will use it's configuration and exporters.

quarkus-micrometer extension configurations should also work, as verified on some tests.

Missing:

  • Native tests
  • Tests with exemplars using OTel Tracing.
  • Documentation updates
  • Decide what to do with the OTel metrics auto instrumentation
  • Move the code to the OTel extension? No.
  • Disable x.histogram in DistributionSummary
  • Silence io.ope.ins.mic.v1_.OpenTelemetryMeterRegistry] (main) A MeterFilter is being configured ...
  • Enable otel metrics and disable otel metrics instrumentation

Copy link

quarkus-bot bot commented Oct 11, 2024

/cc @ebullient (micrometer)

Copy link

github-actions bot commented Oct 11, 2024

🎊 PR Preview a09ea63 has been successfully built and deployed to https://quarkus-pr-main-43831-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from 7b7cc9f to acd0b25 Compare December 18, 2024 17:23
@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from acd0b25 to 35f4d7a Compare January 2, 2025 17:41
@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch 3 times, most recently from 73b8d37 to b7ae30d Compare January 13, 2025 11:13
@quarkus-bot quarkus-bot bot added area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure area/tracing labels Jan 13, 2025
@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch 2 times, most recently from d384469 to 7375f46 Compare January 13, 2025 11:49
@brunobat brunobat marked this pull request as ready for review January 13, 2025 11:49
@brunobat brunobat requested review from alesj and radcortez January 13, 2025 11:49
// // registered to this registry...
// // It's unavoidable because of how Quarkus startup works and users cannot do anything about it.
// // see: https://github.com/micrometer-metrics/micrometer/issues/4920#issuecomment-2298348202
// systemProperty.produce(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radcortez I wonder why this didn't work here... I had to set these properties in the runtime application.properties

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from 7375f46 to cece5ed Compare January 13, 2025 12:41

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from cece5ed to 6647f75 Compare January 13, 2025 14:13

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from 6647f75 to 17812ae Compare January 14, 2025 11:46
@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label Jan 14, 2025

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch 2 times, most recently from 8d89826 to 4065c6c Compare January 14, 2025 15:52
@quarkus-bot quarkus-bot bot added the area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins label Jan 14, 2025

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from 4e1eb78 to e730fe8 Compare January 15, 2025 12:30

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@brunobat
Copy link
Contributor Author

CC @geoand . This one is ready to review.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

I've added some questions and suggestions

builder.withSources(
new PropertiesConfigSource(Map.of(
"quarkus.otel.metrics.enabled", "true"),
"quarkus-micrometer-opentelemetry", 1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is quarkus-micrometer-opentelemetry and why is the value 1?

Comment on lines +1 to +4
#quarkus.log.category."io.quarkus.micrometer".level=DEBUG
quarkus.log.category."io.quarkus.bootstrap".level=INFO
#quarkus.log.category."io.quarkus.arc".level=DEBUG
quarkus.log.category."io.netty".level=INFO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was inherited from the original tests in Micrometer.

@Override
public Object apply(SyntheticCreationalContext<Object> context) {
if (otelRuntimeConfig.sdkDisabled()) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure returning null works? cc @mkouba

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a disabled test and it seems to work.

@brunobat brunobat force-pushed the micrometer-to-otel-bridge branch from e54f679 to 725136a Compare January 17, 2025 17:11
Copy link

quarkus-bot bot commented Jan 17, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 725136a.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Copy link

quarkus-bot bot commented Jan 17, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 725136a.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 extensions/micrometer-opentelemetry/deployment

io.quarkus.micrometer.opentelemetry.deployment.compatibility.HttpCompatibilityTest.testHttpTimerToHistogramCompatibility - History

  • Expecting actual: [ImmutableHistogramPointData{getStartEpochNanos=1737139505325063703, getEpochNanos=1737139506429270821, getAttributes={clientName="localhost", method="GET", outcome="SUCCESS", status="200", uri="/pong/{message}"}, getSum=64.44346999999999, getCount=3, hasMin=true, getMin=4.157228, hasMax=true, getMax=52.968073, getBoundaries=[], getCounts=[3], getExemplars=[ImmutableDoubleExemplarData{filteredAttributes={}, epochNanos=1737139506391000000, spanContext=ImmutableSpanContext{traceId=7076a2a29fb65e82885afe524acc1c89, spanId=6393da49e1d36818, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, value=7.318169}]}, ImmutableHistogramPointData{getStartEpochNanos=1737139505325063703, getEpochNanos=1737139506429270821, getAttributes={clientName="localhost", method="GET", outcome="CLIENT_ERROR", status="400", uri="/pong/{message}"}, getSum=4.827757, getCount=1, hasMin=true, getMin=4.827757, hasMax=true, getMax=4.827757, getBoundaries=[]... - java.lang.AssertionError
java.lang.AssertionError: 

Expecting actual:
  [ImmutableHistogramPointData{getStartEpochNanos=1737139505325063703, getEpochNanos=1737139506429270821, getAttributes={clientName="localhost", method="GET", outcome="SUCCESS", status="200", uri="/pong/{message}"}, getSum=64.44346999999999, getCount=3, hasMin=true, getMin=4.157228, hasMax=true, getMax=52.968073, getBoundaries=[], getCounts=[3], getExemplars=[ImmutableDoubleExemplarData{filteredAttributes={}, epochNanos=1737139506391000000, spanContext=ImmutableSpanContext{traceId=7076a2a29fb65e82885afe524acc1c89, spanId=6393da49e1d36818, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, value=7.318169}]},
    ImmutableHistogramPointData{getStartEpochNanos=1737139505325063703, getEpochNanos=1737139506429270821, getAttributes={clientName="localhost", method="GET", outcome="CLIENT_ERROR", status="400", uri="/pong/{message}"}, getSum=4.827757, getCount=1, hasMin=true, getMin=4.827757, hasMax=true, getMax...

📦 integration-tests/grpc-hibernate

com.example.grpc.hibernate.BlockingRawTest.shouldAdd - History

  • Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at com.example.grpc.hibernate.BlockingRawTestBase.shouldAdd(BlockingRawTestBase.java:59)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)

⚙️ JVM Tests - JDK 17 Windows

📦 extensions/micrometer-opentelemetry/deployment

io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod - History

  • Stream has no elements - java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: Stream has no elements
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lambda$lastReading$2(MetricDataFilter.java:213)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReading(MetricDataFilter.java:213)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReadingDataPoint(MetricDataFilter.java:231)
	at io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod(MicrometerTimedInterceptorTest.java:77)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:513)

⚙️ Gradle Tests - JDK 17

📦 integration-tests/gradle

io.quarkus.gradle.builder.QuarkusModelBuilderTest.shouldLoadSimpleModuleDevModel - History

  • Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.12-bin.zip'. - org.gradle.tooling.BuildException
org.gradle.tooling.BuildException: Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.12-bin.zip'.
	at app//org.gradle.tooling.internal.consumer.ConnectionExceptionTransformer.transform(ConnectionExceptionTransformer.java:69)
	at app//org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:42)
	at app//org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:68)
	at app//org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at app//org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

io.quarkus.gradle.builder.QuarkusModelBuilderTest.shouldLoadSimpleModuleTestModel - History

  • Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.12-bin.zip'. - org.gradle.tooling.BuildException
org.gradle.tooling.BuildException: Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.12-bin.zip'.
	at app//org.gradle.tooling.internal.consumer.ConnectionExceptionTransformer.transform(ConnectionExceptionTransformer.java:69)
	at app//org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:42)
	at app//org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:68)
	at app//org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at app//org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

@geoand
Copy link
Contributor

geoand commented Jan 18, 2025

The CI failure seems related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure area/metrics area/tracing release/noteworthy-feature triage/backport triage/flaky-test
Projects
Status: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants