-
Notifications
You must be signed in to change notification settings - Fork 705
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
WebClient's URI_TEMPLATE_ATTRIBUTE ignored by MicrometerStatsLoadBalancerLifecycle #1302
Comments
Hi @JaroslawDembek, thanks for raising the issue. Would you like to submit a PR with the changes? If yes, please keep in mind that since this introduces a possibly breaking behaviour change, then method would need to use a flag to go the old path or the new one, with the flag already being deprecated since we'd transition to the new behaviour as the only one with the next major release. If you don't want to work on the PR, no worries - we'll take care of it. |
I am already using overrided version of metric collector with SpringBoot3 so it shouldn't be a big task. |
@OlgaMaciaszek |
Version: 4.0.4
Problem
When
spring.cloud.loadbalancer.stats.micrometer.enabled: true
using WebClient with loadbalancing can lead to generation of huge number of metrics when path contains params, e.g./test/{somePerCallId}/...
what eventually with high workload can cause even OOM.Common approach
Spring metrics collectors for
WebClient uses URI_TEMPLATE_ATTRIBUTE
(which contains placeholder instead of actual param value) to overcome problem mention above.Solution:
Make
MicrometerStatsLoadBalancerLifecycle
URI_TEMPLATE_ATTRIBUTE
aware.Now this logic is hidden in
LoadBalancerTags
utility class.Possibly
MicrometerStatsLoadBalancerLifecycle
could be aware of client type.Alternative:
Set
spring.cloud.loadbalancer.stats.micrometer.enabled: false
and deliver you own metrics collector as bean implementingLoadBalancerLifecycle
to overrideLoadBalancerTags.getPath
with e.g.The text was updated successfully, but these errors were encountered: