Open hdv opened 2 years ago
Is this still a problem with the latest versions?
The behavior you're seeing is I believe how Reactor Netty's TcpClient
works. We are using a publisher that will publish each line individually (unbuffered), but I think buffering is happening in the TcpClient
after that. Maybe @violetagg can confirm.
https://github.com/micrometer-metrics/micrometer/blob/d00abb9ae5b166c421803d9fa2060c15f3e62189/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdMeterRegistry.java#L263-L266
Where the publisher is a DirectProcessor.create()
when our buffered
config is false
:
https://github.com/micrometer-metrics/micrometer/blob/225234755f1ad70cd67eea167862c1cedddc0cd2/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdMeterRegistry.java#L91
https://github.com/micrometer-metrics/micrometer/blob/d00abb9ae5b166c421803d9fa2060c15f3e62189/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdMeterRegistry.java#L221-L229
Describe the bug Run
StatsdMeterRegistryPublishTest.receiveParallelMetricsSuccessfully
test and inspect console output. StatsdMeterRegistry is configured to be unbuffered (new StatsdMeterRegistry(getUnbufferedConfig(protocol, port), Clock.SYSTEM);
) For both UDP and UDS_DATAGRAM modes samples are reported one by one. For TCP they are batched.Environment
To Reproduce How to reproduce the bug: Run
StatsdMeterRegistryPublishTest.receiveParallelMetricsSuccessfully
test and inspect console outputExpected behavior For TCP mode samples should be reported separately, one by one
Additional context Discovered during https://github.com/micrometer-metrics/micrometer/issues/2880