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

fix micrometer bridge auto configuration annotation #13083

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

zeitlinger
Copy link
Member

Fixes #12719 - hopefully

@zeitlinger zeitlinger requested a review from a team as a code owner January 22, 2025 13:05
@zeitlinger zeitlinger changed the title fix annotation fix micrometer bridge auto configuration annotation Jan 22, 2025
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

do you think a test could be added for this?

@zeitlinger
Copy link
Member Author

do you think a test could be added for this?

yes - I even found the test that I broke with this PR.

@zeitlinger zeitlinger self-assigned this Jan 23, 2025
@zeitlinger zeitlinger force-pushed the micrometer-bridge-auto-config branch from a888249 to b9a2ab1 Compare January 27, 2025 13:43
Comment on lines +25 to +33
testing {
suites {
val testPrometheus by registering(JvmTestSuite::class) {
dependencies {
runtimeOnly("io.micrometer:micrometer-registry-prometheus:1.14.3")
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

what's the failure for this test without your change to OpenTelemetryMeterRegistry?

Copy link
Member Author

Choose a reason for hiding this comment

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

just tried... there is no failure - which confirms that the error does not always appear

but I've improved the test

Copy link
Member

Choose a reason for hiding this comment

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

what's the failure now (without your change to OpenTelemetryMeterRegistry)?

Copy link
Member Author

Choose a reason for hiding this comment

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

@trask the test is still passing with the unchanged code

I don't know how to force spring to use a different resolution order from the provided constraints

Copy link
Member Author

Choose a reason for hiding this comment

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

the test is still passing the old code - but I don't have an idea how to make a better test - you'd have to force spring to randomize the bean order within the provided constraints

Copy link
Member

Choose a reason for hiding this comment

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

thanks, makes sense

@AutoConfigureAfter(SimpleMetricsExportAutoConfiguration.class)
@AutoConfigureAfter({
SimpleMetricsExportAutoConfiguration.class,
PrometheusMetricsExportAutoConfiguration.class
Copy link
Member

Choose a reason for hiding this comment

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

is there a way to do this generically for all other MeterRegistries? (not only simple and prometheus?)

Copy link
Member Author

Choose a reason for hiding this comment

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

do you want to add more different configs that load different metric registries? sounds too much - @jeanbisutti what's your take?

Copy link
Member

Choose a reason for hiding this comment

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

no, asking if there's a way to do it generically, so that it loads after all other MeterRegistries, without having to hard-code specific meter registries

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 this pull request may close these issues.

Micrometer-bridge breaks Spring Actuator metrics
2 participants