Skip to content
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

management.observations.http.server.requests.name no longer has any effect #39083

Closed
mbanaszkiewicz-vonage opened this issue Jan 10, 2024 · 5 comments
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@mbanaszkiewicz-vonage
Copy link

mbanaszkiewicz-vonage commented Jan 10, 2024

When using spring-boot-starter-webflux with spring-boot-starter-parent=3.1.7, server/client metrics are properly aliased via "management.observations.http.server.requests.name" documented application property:

2024-01-10T14:44:05.179+01:00 INFO 757337 --- [trics-publisher] i.m.c.i.logging.LoggingMeterRegistry : ALIASED{error=none,exception=none,method=GET,outcome=SUCCESS,status=200,uri=/test} throughput=0.2/s mean=0.003425731s max=0.020831402s

After switching to spring-boot-starter-parent=3.2.0, aliasing doesn't work and default name is used (same for reactive webclient metrics, skipped for brevity):
2024-01-10T14:46:07.906+01:00 INFO 757965 --- [trics-publisher] i.m.c.i.logging.LoggingMeterRegistry : http.server.requests{error=none,exception=none,method=GET,outcome=SUCCESS,status=200,uri=/test} throughput=0.2/s mean=0.016004746s max=0.024342709s

Steps to reproduce:

  1. clone https://github.com/mbanaszkiewicz-vonage/metric-aliasing-repro
  2. run the ServiceApplication spring boot app
  3. go to http://localhost:9000/test to generate some server request metrics
  4. inspect stdout of the app - there is a logging meter registry that prints metrics every 10s. Repo version uses boot 3.1.7 so 'ALIASED' text should be visible
  5. do the same after bumping boot to 3.2.0 - 'http.server.requests' is visible instead of 'ALIASED' in stdout
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 10, 2024
@mbanaszkiewicz-vonage
Copy link
Author

Workaround seems to be exposing a bean that extends DefaultServerRequestObservationConvention and call super(@value("${management.observations.http.server.requests.name}")

@wilkinsona
Copy link
Member

Thanks for the report. It looks like this functionality was lost as part of #37344. I think we need to auto-configure a DefaultServerRequestObservationConvention with the value of management.observations.http.server.requests.name. It should be @ConditionalOnMissingBean to allow any custom convention to continue to take precedence.

@wilkinsona
Copy link
Member

same for reactive webclient metrics

I can't see why WebClient metrics would be affected unless you were using the deprecated management.metrics.web.client.request.metric-name property as, since Boot 3.2, management.observations.http.client.requests.name must be used instead. Can you please elaborate?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jan 10, 2024
@mbanaszkiewicz-vonage
Copy link
Author

Doublechecked WebClient metrics - works correctly when new property used, I must have used WebClientBuilder created by hand or something bad when checking this. So only server.requests.name issue remains. Thanks

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 10, 2024
@wilkinsona wilkinsona changed the title Observations aliasing broken since spring-boot-starter-parent 3.2.0 management.observations.http.server.requests.name no longer has any effect Jan 10, 2024
@wilkinsona wilkinsona added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jan 10, 2024
@wilkinsona wilkinsona added this to the 3.2.x milestone Jan 10, 2024
@mhalbritter mhalbritter self-assigned this Jan 11, 2024
@mhalbritter
Copy link
Contributor

Ugh, fixed on the wrong branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

4 participants