Support common-tags alias for Micrometer common tags#1155
Open
n0tl3ss wants to merge 4 commits into
Open
Conversation
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
n0tl3ss
requested review from
alvarosanchez,
Copilot and
sdelamo
and removed request for
Copilot
April 27, 2026 16:29
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds support for the micronaut.metrics.common-tags.* alias (while keeping the legacy micronaut.metrics.tags.* working) and adds regression coverage to ensure common tags are applied before meters are registered.
Changes:
- Added documentation describing
micronaut.metrics.common-tags.*as the preferred alias while supporting the legacy prefix. - Updated common-tag resolution logic to merge tags from both prefixes.
- Added/updated Spock specs to cover both prefixes and a Prometheus-specific ordering regression.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/docs/guide/metricsConcepts.adoc | Documents the new common-tags alias and provides configuration example. |
| micrometer-registry-prometheus/src/test/groovy/io/micronaut/configuration/metrics/micrometer/prometheus/PrometheusMeterRegistryFactorySpec.groovy | Adds regression test ensuring common tags are applied before meter registration. |
| micrometer-core/src/test/groovy/io/micronaut/configuration/metrics/micrometer/MeterRegistryConfigurerOrderSpec.groovy | Updates expected configurer count/order now that common tags are conditional. |
| micrometer-core/src/test/groovy/io/micronaut/configuration/metrics/management/endpoint/MetricsEndpointSpec.groovy | Parameterizes common-tags test to validate both property prefixes. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/micrometer/MeterRegistryFactory.java | Introduces distinct constants for legacy tags vs alias common-tags. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/common/tags/CommonTagsConfigurer.java | Reads tags from both prefixes via Environment and applies them as common tags. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/common/tags/CommonTagsCondition.java | Activates common-tags configurer when either prefix is configured. |
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
|
sdelamo
approved these changes
Jun 9, 2026
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.*andmicronaut.metrics.common-tags.*when building common tagsmicronaut.metrics.common-tags.*as the clearer alias while keeping the legacy prefix workingVerification
./gradlew :micronaut-micrometer-core:test --rerun-tasks --tests 'io.micronaut.configuration.metrics.management.endpoint.MetricsEndpointSpec' --tests 'io.micronaut.configuration.metrics.micrometer.MeterRegistryConfigurerOrderSpec'./gradlew :micronaut-micrometer-registry-prometheus:test --tests 'io.micronaut.configuration.metrics.micrometer.prometheus.PrometheusMeterRegistryFactorySpec'Resolves #114