-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Low cardinality key for uri is reported as UNKNOWN in DefaultServerRequestObservationConvention #40923
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
Comments
Can you share a minimal sample we can have a look at? |
Hey @bclozel, test is quite simple. We have DataDog dashboards that expect certain tags in the it's not visible here but before the test starts, we run a warmup client that sends 400 requests to the @Test
public void it_pongs() {
RestTemplate restTemplate = builder.build();
assertThat(restTemplate
.getForEntity("http://localhost:53609/ping", Void.class)
.getStatusCode())
.isEqualTo(HttpStatus.OK);
assertThat(meterRegistry
.timer(
"http.server.requests",
Tags.of(
"error", "none",
"exception", "none",
"method", "POST",
"outcome", "SUCCESS",
"status", "200",
"uri", "/graphql",
"user", warmupUserName))
.count())
.isEqualTo(400);
} IssueAfter upgrading to Spring Boot version |
forgot to mention, we have public class ExtendedServerRequestObservationConvention extends DefaultServerRequestObservationConvention {
@NotNull @Override
public KeyValues getLowCardinalityKeyValues(ServerRequestObservationContext context) {
return super.getLowCardinalityKeyValues(context).and(custom(context));
}
@NotNull @Override
public KeyValues getHighCardinalityKeyValues(ServerRequestObservationContext context) {
return super.getHighCardinalityKeyValues(context).and(custom(context));
}
protected KeyValue custom(ServerRequestObservationContext context) {
return KeyValue.of(
"user",
SecurityHelper.extractUserNameFromAuthHeaderOrDefault(
context.getCarrier().getHeader(HttpHeaders.AUTHORIZATION)));
}
}
|
I don't think anything there is relevant to the issue, this information is missing out of the box at runtime, even without custom conventions. I've created spring-projects/spring-graphql#987 to track this. |
Hello community 👋,
We have a test that validates the
http.server.requests
metric with tags collected in Micrometer inspring-graphql
application as follows:Issue
After upgrading to Spring Boot version
3.3.0
, this test is failing. Upon debugging, I discovered that the low-cardinality keyuri
is now being reported asUNKNOWN
inDefaultServerRequestObservationConvention
.Since spring boot
3.3.0
includes dependency update forgraphql-java v22.0
can you help me to find the root cause of theuri
being collected asUNKNOWN
The text was updated successfully, but these errors were encountered: