From 88597f187ba650bd1d4a107bbd266db6ea1eeb76 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 10 Dec 2022 23:32:29 -0800 Subject: [PATCH] app/{vmagent,vminsert}/datadog: make the `host` label optional in DataDog data ingestion protocol Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3432 --- app/vmagent/datadog/request_handler.go | 10 ++++++---- app/vminsert/datadog/request_handler.go | 4 +++- docs/CHANGELOG.md | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/vmagent/datadog/request_handler.go b/app/vmagent/datadog/request_handler.go index ae337be8b1..2b7aa5a270 100644 --- a/app/vmagent/datadog/request_handler.go +++ b/app/vmagent/datadog/request_handler.go @@ -52,10 +52,12 @@ func insertRows(at *auth.Token, series []parser.Series, extraLabels []prompbmars Name: "__name__", Value: ss.Metric, }) - labels = append(labels, prompbmarshal.Label{ - Name: "host", - Value: ss.Host, - }) + if ss.Host != "" { + labels = append(labels, prompbmarshal.Label{ + Name: "host", + Value: ss.Host, + }) + } if ss.Device != "" { labels = append(labels, prompbmarshal.Label{ Name: "device", diff --git a/app/vminsert/datadog/request_handler.go b/app/vminsert/datadog/request_handler.go index ba5135b149..6dbfbbbec7 100644 --- a/app/vminsert/datadog/request_handler.go +++ b/app/vminsert/datadog/request_handler.go @@ -54,7 +54,9 @@ func insertRows(series []parser.Series, extraLabels []prompbmarshal.Label) error rowsTotal += len(ss.Points) ctx.Labels = ctx.Labels[:0] ctx.AddLabel("", ss.Metric) - ctx.AddLabel("host", ss.Host) + if ss.Host != "" { + ctx.AddLabel("host", ss.Host) + } if ss.Device != "" { ctx.AddLabel("device", ss.Device) } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 8078517338..7b5f504c15 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -54,6 +54,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): allow using `series_limit` option for [limiting the number of series a single scrape target generates](https://docs.victoriametrics.com/vmagent.html#cardinality-limiter) in [stream parsing mode](https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3458). * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): allow using `sample_limit` option for limiting the number of metrics a single scrape target can expose in every response sent over [stream parsing mode](https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode). * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add `exported_` prefix to metric names exported by scrape targets if these metric names clash with [automatically generated metrics](https://docs.victoriametrics.com/vmagent.html#automatically-generated-metrics) such as `up`, `scrape_samples_scraped`, etc. This prevents from corruption of automatically generated metrics. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3406). +* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): make the `host` label optional in [DataDog data ingestion protocol](https://docs.victoriametrics.com/#how-to-send-data-from-datadog-agent). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3432). * FEATURE: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): improve error message when the requested path cannot be properly parsed, so users could identify the issue and properly fix the path. Now the error message links to [url format docs](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3402). * FEATURE: [VictoriaMetrics enterprise cluster](https://docs.victoriametrics.com/enterprise.html): add `-storageNode.discoveryInterval` command-line flag to `vmselect` and `vminsert` to control load on DNS servers when [automatic discovery of vmstorage nodes](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#automatic-vmstorage-discovery) is enabled. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3417). * FEATURE: [VictoriaMetrics enterprise cluster](https://docs.victoriametrics.com/enterprise.html): allow reading and updating the list of `vmstorage` nodes at `vmselect` and `vminsert` nodes via file. See [automatic discovery of vmstorage](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#automatic-vmstorage-discovery) for details.