influxdata/telegraf

feat(outputs.datadog): Support for Dogstatsd Events

开放

#16,130 创建于 2024年11月4日

 (7 条评论) (0 个反应) (0 位负责人)Go (5,838 个派生)batch import
feature requesthelp wanted

仓库指标

星标
 (17,764 个星标)
PR 合并指标
 (平均合并 2天 12小时) (30 天内合并 136 个 PR)

描述

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.

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 at https://api.datadoghq.com/api/v1/events.

Here is an example event that appears in outputs.datadog:

  {
    "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.

贡献者指南