-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Make WebSocketMessageBrokerStats optionally export stats to micrometer #31604
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
Sorry for the delayed response. Spring Framework only depends on the The log line contains several parts:
The "inboundChannel", "outboundChannel" and "sockJsScheduler" are all Stringly typed as this information is extracted directly from As for the "WebSocketSession", "stompSubProtocol", "stompBrokerRelay", they all have dedicated @Nullable
public StompSubProtocolHandler.Stats getStompSubProtocolStats() {
return (this.stompSubProtocolHandler != null ? this.stompSubProtocolHandler.getStats() : null);
} This would allow applications to register gauges with the metric names and tags of their choices: MeterRegistry meterRegistry = ...;
Gauge.builder("spring.stomp.frames", stats.getStompSubProtocolStats(), StompSubProtocolHandler.Stats::getTotalConnect)
.tag("type", "CONNECT")
.description("number of CONNECT frames processed")
.register(meterRegistry);
Gauge.builder("spring.stomp.frames", stats.getStompSubProtocolStats(), StompSubProtocolHandler.Stats::getTotalConnected)
.tag("type", "CONNECTED")
.description("number of CONNECTED frames processed")
.register(meterRegistry); The only downside here is that such metrics would probably fit more with @nyilmaz What do you think about this proposal? |
This would be perfectly OK and enough form most of the time, also leaving metering library free to choose. Thanks for your attention 👍 and observation! A separate bean can be defined to automatically wired in to collect those metrics and expose them via prometheus, however my last sentence addresses spring-boot's side I think. How can we proceed from now on? |
I'll take care of it. Thanks for your feedback! |
Currently we access stats via logs which
WebSocketMessageBrokerStats
produce. Would you consider exporting those metrics to any stats collector? If interested, we can create a pr for this.https://stackoverflow.com/questions/57481608/how-to-access-and-export-websocketmessagebrokerstats-internal-counts
The text was updated successfully, but these errors were encountered: