influxdata / influxdata/telegraf
feat(outputs.datadog): Support for Dogstatsd Events
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Use Case
Dogstatsd allows for events to be published to a StatsD server (typically Datadog Agent) which then is displayed as an Event in Datadog.
https://docs.datadoghq.com/service_management/events/guides/dogstatsd/
In the below PR, inputs.statsd was modified to support parsing the event datagram into a `telegraf.Metric`.
- https://github.com/influxdata/telegraf/pull/5791
### Expected behavior
An event is published to Datadog.
### Actual behavior
No event is published to Datadog.
### Additional info
It doesn't look like outputs.datadog supports submitting events. It assumes all data received from the accumulator are metric series and converts them as such. The URL even defaults to `https://app.datadoghq.com/api/v1/series`, whereas events are submitted to [Events API](https://docs.datadoghq.com/api/latest/events/) at `https://api.datadoghq.com/api/v1/events`.
Here is an example event that appears in outputs.datadog:
```json
{
"MetricName": "jdheyburn test event",
"MetricTags": [
{ "Key": "datadog-statsd", "Value": "true" },
{ "Key": "host", "Value": "telegraf-events-0" },
],
"MetricFields": [
{ "Key": "priority", "Value": "normal" },
{ "Key": "alert_type", "Value": "info" },
{ "Key": "text", "Value": "from statsd" }
],
"MetricTime": "2024-11-01T19:59:54.891658849Z",
"MetricType": 3
},
```
MetricType is telegraf.Untyped. Currently its trying to convert it to a metric and submit it to the series endpoint, whereas it should convert it to an Event and submit it to the correct endpoint.
Contributor guide
Research direction
Start by reading the inputs.statsd event parsing changes in PR #5791 and the outputs.datadog implementation. Trace how telegraf.Untyped metrics are converted and submitted, then compare the series endpoint with the Datadog Events API. Done means StatsD events reach the Events API while ordinary metric series continue using the series endpoint, with tests covering both paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100