Add common tags via configuration#1160
Open
n0tl3ss wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for configuring Micrometer common tags via a clearer micronaut.metrics.common-tags.* alias while retaining compatibility with the legacy micronaut.metrics.tags.* prefix.
Changes:
- Introduces
micronaut.metrics.common-tags.*as an alias for common tag configuration, while still supportingmicronaut.metrics.tags.*. - Updates common tag wiring to be conditionally enabled when either prefix is configured, and reads tags from both dotted and map-form configs.
- Extends endpoint tests to cover both prefixes and both configuration styles.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/docs/guide/metricsConcepts.adoc | Documents common tag configuration and the new alias prefix. |
| micrometer-core/src/test/groovy/io/micronaut/configuration/metrics/micrometer/MeterRegistryConfigurerOrderSpec.groovy | Updates expectations now that the common-tags configurer is conditional. |
| micrometer-core/src/test/groovy/io/micronaut/configuration/metrics/management/endpoint/MetricsEndpointSpec.groovy | Adds matrix coverage for dotted vs map config and both tag prefixes. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/micrometer/MeterRegistryFactory.java | Splits constants for legacy tags vs new common-tags prefix. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/common/tags/CommonTagsConfigurer.java | Reads tags from both prefixes using Environment and applies them as common tags. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/common/tags/CommonTagsCondition.java | Enables the configurer when either prefix is present (dotted or map form). |
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
micronaut.metrics.tags.*configuration.micronaut.metrics.common-tags.*as a clearer alias for common tag configuration.micronaut.metrics.common-tags.*override legacymicronaut.metrics.tags.*values for duplicate keys and ignore null common tag values.Verification
./gradlew :micronaut-micrometer-core:test --rerun-tasks --tests 'io.micronaut.configuration.metrics.common.tags.CommonTagsConfigurerSpec' --tests 'io.micronaut.configuration.metrics.management.endpoint.MetricsEndpointSpec' --tests 'io.micronaut.configuration.metrics.micrometer.MeterRegistryConfigurerOrderSpec'Resolves #1050