StatsD Logging Plugin

Use the StatsD Logging plugin to log API metrics StatsD server. It can also be used to log metrics on Collectd daemon by enabling its Statsd plugin. Give it a try and discuss it here!

StatsD Logging plugin documentation

Hi there!

We would like to set the statsd sample rate to something less than 1. However, I see in the code that this is explicitly blocked https://github.com/Kong/kong/blob/master/kong/plugins/statsd/schema.lua#L103

Is there any reason why or am I misunderstanding something? The option doesn’t seem super useful if it can’t be less than 100%.

Just an update - I went directly to the database and changed the value:

update plugins
set config = ‘{
“metrics”: [
{
“stat_type”: “counter”,
“sample_rate”: 0.1,
“name”: “request_count”
}, etc…}’
where id = ‘xxxxx’

And after reload, it actually did happily send statsd messages with 0.1 as the sample rate. However, it still sent 100% of the messages, so to the statsd server, the counters appeared inflated by 10x. So my guess is that locking to ‘1’ as the sample rate is because the plugin as the statsd client hasn’t implemented utilization of a user-configured sample rate.