-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Expected Behavior
From Micrometer's Prometheus documentation, the same metric name cannot be registered with different tags. It seems like with the latest Micronaut Parent (4.9.3) with the Micronaut Micrometer version 5.12.0, there are places where certain tags are not being added:
WebMetricsHelper
private static @Nullable Tag serviceId(@Nullable String serviceId) {
return serviceId == null ? null : Tag.of("serviceId", serviceId);
}I am assuming that a default value should be provided for this tag.
Actual Behaviour
The above issue is causing the following warning:
This causes the following warning
The meter (MeterId{name='http.client.requests', tags=[tag(exception=none),tag(method=GET),tag(status=200),tag(uri=UNKNOWN)]}) registration has failed: Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named 'http_client_requests_seconds' containing tag keys [exception, method, serviceId, status, uri]. The meter you are attempting to register has keys [exception, method, status, uri]. Note that subsequent logs will be logged at debug level.
Steps To Reproduce
- Depend on Micronaut Micrometer 5.12.0 and Micronaut Prometheus Registry
- Perform request without Service Id present
- Should log the warning
Environment Information
- Java 21
- Micronaut 4.9.3
Example Application
No response
Version
4.9.3, Micrometer Version 5.12.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels