Rename gateway client observation metric to avoid WebClient conflict#4153
Open
LivingLikeKrillin wants to merge 4 commits into
Open
Rename gateway client observation metric to avoid WebClient conflict#4153LivingLikeKrillin wants to merge 4 commits into
LivingLikeKrillin wants to merge 4 commits into
Conversation
4bc48e8 to
775f910
Compare
Renames DefaultGatewayObservationConvention's metric from 'http.client.requests' to 'spring.cloud.gateway.http.client.requests' so it no longer collides with Spring Web's DefaultClientRequestObservationConvention, which uses the same name with a different low-cardinality label set and causes Prometheus to drop one of the two series. Fixes spring-cloudgh-3153 Signed-off-by: Jooyoung Jung <143606756+LivingLikeKrillin@users.noreply.github.com>
Explains on DefaultGatewayObservationConvention#getName() why the metric is prefixed with 'spring.cloud.gateway.' so a future reader does not revert the rename without understanding the Prometheus collision it avoids. See spring-cloudgh-3153 Signed-off-by: Jooyoung Jung <143606756+LivingLikeKrillin@users.noreply.github.com>
Adds focused unit assertions for the gateway client observation convention beyond the metric name renamed in the previous commit: - guard that getName() does not equal Spring Web's http.client.requests - getContextualName span naming - low-cardinality key set (http.method, http.status_code, and both spring.cloud.gateway.route.* keys) Previously only covered indirectly by the integration-style ObservedHttpHeadersFilterTests. See spring-cloudgh-3153 Signed-off-by: Jooyoung Jung <143606756+LivingLikeKrillin@users.noreply.github.com>
Regenerated by micrometer-docs-generator after the gateway client observation metric rename in the previous commits. No hand edits. See spring-cloudgh-3153 Signed-off-by: Jooyoung Jung <143606756+LivingLikeKrillin@users.noreply.github.com>
775f910 to
d6fb917
Compare
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.
Gateway and Spring Web's DefaultClientRequestObservationConvention both
publish under http.client.requests but emit different low-cardinality
label sets, so a Prometheus registry refuses to register one of them
and a metric series is silently dropped. Spring Boot 3.4+ logs this
as a meter registration failure.
Rename the gateway client observation to spring.cloud.gateway.http.client.requests
so it can coexist with WebClient's metric. The .active LongTaskTimer
variant follows automatically.
This is a breaking change for dashboards, alerts, and queries
referencing the old metric name. Users who already customize the
convention via a GatewayObservationConvention bean are unaffected.
Fixes gh-3153