diff --git a/docs/Sending_DD_metrics_to_VM.png b/docs/Sending_DD_metrics_to_VM.png new file mode 100644 index 0000000000..abe4e5feda Binary files /dev/null and b/docs/Sending_DD_metrics_to_VM.png differ diff --git a/docs/Sending_DD_metrics_to_VM_and_DDhq.png b/docs/Sending_DD_metrics_to_VM_and_DDhq.png new file mode 100644 index 0000000000..28d2947ac5 Binary files /dev/null and b/docs/Sending_DD_metrics_to_VM_and_DDhq.png differ diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index a44e1c14b4..100a9457ae 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -343,20 +343,73 @@ See also [vmagent](https://docs.victoriametrics.com/vmagent.html), which can be VictoriaMetrics accepts data from [DataDog agent](https://docs.datadoghq.com/agent/) or [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/) via ["submit metrics" API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) at `/datadog/api/v1/series` path. -### Single-node VictoriaMetrics: +### Sending metrics to VictoriaMetrics -Run DataDog agent with environment variable `DD_DD_URL=http://victoriametrics-host:8428/datadog`. Alternatively, set `dd_url` param at [DataDog agent configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/) to `http://victoriametrics-host:8428/datadog`. +DataDog agent allows configuring destinations for metrics sending via ENV variable `DD_DD_URL` or via [configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/) in section `dd_url`. -### Cluster version of VictoriaMetrics: +

+ +

-Run DataDog agent with environment variable `DD_DD_URL=http://vinsert-host:8480/insert/0/datadog`. Alternatively, set `dd_url` param at [DataDog agent configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/) to `DD_DD_URL=http://vinsert-host:8480/insert/0/datadog`. +Depending on where you want to send metrics, the [URL for VictoriaMetrics](https://docs.victoriametrics.com/url-examples.html#datadog) will be different: +1. Run DataDog using this ENV variable for sending metrics to VictoriaMetrics -VictoriaMetrics doesn't check `DD_API_KEY` param, so it can be set to arbitrary value. +
+ +``` +DD_DD_URL=http://victoriametrics:8428/datadog +``` + +
+ +Alternatively add this `dd_url` to DataDog YAML configuration file. + +
+ +``` +dd_url: http://victoriametrics:8428/datadog +``` + +
+ +2. vmagent also can accept Datadog metrics format. Depending on where vmagent will forward data, pick the single-node or cluster URL formats. + +### Sending metrics to Datadog and VictoriaMetrics + +DataDog allows configuring [Dual Shipping](https://docs.datadoghq.com/agent/guide/dual-shipping/) for metrics sending via ENV variable `DD_ADDITIONAL_ENDPOINTS` or via configuration file `additional_endpoints` described in section YAML configuration. + +

+ +

+ +Run DataDog using this ENV variable for sending metrics to the single-node VictoriaMetrics on top of DataDoghq. + +
+ +``` +DD_ADDITIONAL_ENDPOINTS='{\"http://victoriametrics:8428/datadog\"}' +``` + +
+ +Alternatively add an `additional_endpoints` to [DataDog agent configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/). + +
+ +``` +dd_url: http://victoriametrics:8428/datadog +``` + +
+ +### Send via cURL Example of how to send data to VictoriaMetrics via [DataDog "submit metrics"](https://docs.victoriametrics.com/url-examples.html#datadogapiv1series) from command line: ### Single-node VictoriaMetrics: +
+ ```console echo ' { @@ -376,8 +429,9 @@ echo ' } ] } -' | curl -X POST --data-binary @- http://victoriametrics-host:8428/datadog/api/v1/series +' | curl -X POST --data-binary @- http://victoriametrics:8428/datadog/api/v1/series ``` +
### Cluster version of VictoriaMetrics: @@ -402,7 +456,7 @@ echo ' } ] } -' | curl -X POST --data-binary @- http://vminsert-host:8480/insert/0/datadog/api/v1/series +' | curl -X POST --data-binary @- http://vminsert:8480/insert/0/datadog/api/v1/series ``` @@ -415,7 +469,7 @@ The imported data can be read via [export API](https://docs.victoriametrics.com/
```console -curl http://victoriametrics-host:8428/api/v1/export -d 'match[]=system.load.1' +curl http://victoriametrics:8428/api/v1/export -d 'match[]=system.load.1' ```
@@ -425,7 +479,7 @@ curl http://victoriametrics-host:8428/api/v1/export -d 'match[]=system.load.1'
```console -curl http://vmselect-host:8481/select/0/prometheus/api/v1/export -d 'match[]=system.load.1' +curl http://vmselect:8481/select/0/prometheus/api/v1/export -d 'match[]=system.load.1' ```
@@ -436,6 +490,8 @@ This command should return the following output if everything is OK: {"metric":{"__name__":"system.load.1","environment":"test","host":"test.example.com"},"values":[0.5],"timestamps":[1632833641000]} ``` +### Additional details + VictoriaMetrics automatically sanitizes metric names for the data ingested via DataDog protocol according to [DataDog metric naming recommendations](https://docs.datadoghq.com/metrics/custom_metrics/#naming-custom-metrics). If you need accepting metric names as is without sanitizing, then pass `-datadog.sanitizeMetricName=false` command-line flag to VictoriaMetrics. @@ -455,7 +511,7 @@ See [these docs](https://docs.victoriametrics.com/vmagent.html#adding-labels-to- ## How to send data from InfluxDB-compatible agents such as [Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) -Use `http://:8428` url instead of InfluxDB url in agents' configs. +Use `http://:8428` url instead of InfluxDB url in agents' configs. For instance, put the following lines into `Telegraf` config, so it sends data to VictoriaMetrics instead of InfluxDB: ```toml diff --git a/docs/url-examples.md b/docs/url-examples.md index 9f0ac3e571..c955573644 100644 --- a/docs/url-examples.md +++ b/docs/url-examples.md @@ -437,6 +437,28 @@ Additional information: * [TSDB Stats](https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats) * [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format) +## /datadog + +**DataDog URL for Single-node VictoriaMetrics** + +
+ +``` +http://victoriametrics:8428/datadog +``` + +
+ +**DataDog URL for Cluster version of VictoriaMetrics** + +
+ +``` +http://vminsert:8480/insert/0/datadog +``` + +
+ ## /datadog/api/v1/series **Imports data in DataDog format into VictoriaMetrics**