Created
February 15, 2019 14:07
-
-
Save jkschneider/a937cab4945a83b356f79c9331cd3e48 to your computer and use it in GitHub Desktop.
How to send StatsD metrics over AMQP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
StatsdMeterRegistry statsdMeterRegistry(StatsdConfig config) { | |
return StatsdMeterRegistry.builder(config) | |
.lineSink(line -> { | |
// send this line to AMQP with your broker's client library | |
}) | |
.build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since you're using Influx, you'll want to use the Telegraf StatsD flavor:
Micrometer uses a variation on Nagle's algorithm to batch up tightly clustered StatsD line emissions into a single payload. You don't need to think about any of this. Just pop off whatever is on the AMQP message and stuff it directly in Telegraf on the high side. Depending on your configuration, you may be able to use the Telegraf AMQP consumer input plugin and not have a custom component on the high side.