logstash-plugins / logstash-output-datadog_metrics

Apache License 2.0
3 stars 18 forks source link

Aggregate events for counters before sending them to the Datadog API #12

Open dax opened 7 years ago

dax commented 7 years ago

Logstash events might increment a unique counter metric (with the same tags, type, ...) during a single API call timeframe. We must aggregate these events before sending a value to the Datadog API.

Another case which result to wrong count value in Datadog is when 2 identical events are handled in 2 differents Datadog API calls. When using event.timestamp as Datadog timestamp, identical events will overwrite any previous value sent to the Datadog API. For example, event1 is sent with a first Datadog API call. Later, a delayed event2, identical (same tags, metric name, type and timestamp) to event1, is handled after the first Datadog API call. Datadog will then overwrite the value sent with event1 by the value sent with event2.