Skip to content

Add assertion for no re-registering Kafka metrics #6119

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

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

izeye
Copy link
Contributor

@izeye izeye commented Apr 15, 2025

This PR adds an assertion for no re-registering Kafka metrics.

This PR also copies the OutputCaptureExtension and its support classes from Spring Boot to assert it. While copying it, I dropped the AnsiOutput support as it requires more classes that don't require for this.

See gh-6068

This commit also copies OutputCaptureExtension to assert it.

See micrometer-metricsgh-6068

Signed-off-by: Johnny Lim <[email protected]>
Copy link
Member

@jonatan-ivanov jonatan-ivanov left a comment

Choose a reason for hiding this comment

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

Could you please add a permalink to the javadoc of the copied classes that tells where they were copied from?
E.g.:

Copied from: https://github.com/spring-projects/spring-boot/blob/88c9ae97b5638491964537bb5b1f7dfbea1ae047/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/CapturedOutput.java

Also, if we want to use these in other modules, we might need to relocate them but for now I think we can keep them here.

@jonatan-ivanov jonatan-ivanov added this to the 1.13.14 milestone Apr 15, 2025
@jonatan-ivanov jonatan-ivanov added type: task A general task instrumentation An issue that is related to instrumenting a component labels Apr 15, 2025
@izeye
Copy link
Contributor Author

izeye commented Apr 15, 2025

@jonatan-ivanov Sure, I applied your suggestion in ffb5881.

@jonatan-ivanov jonatan-ivanov merged commit d192fda into micrometer-metrics:1.13.x Apr 15, 2025
8 checks passed
@jonatan-ivanov
Copy link
Member

Thank you!

@izeye izeye deleted the gh-6068 branch April 16, 2025 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instrumentation An issue that is related to instrumenting a component type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants