From 09db7e40017048fb5bc782578a6d643ad62f657e Mon Sep 17 00:00:00 2001 From: Denis Washington Date: Fri, 6 May 2022 08:35:10 +0200 Subject: [PATCH 1/2] Extend documentation on Datadog metrics - Document that an application key must be set to publish metadata for the exported metrics. - Point out that using a non-US Datadog site (e.g., EU) requires changing the `uri` property. See gh-30879 --- .../export/datadog/DatadogProperties.java | 4 ++-- .../src/docs/asciidoc/actuator/metrics.adoc | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java index 139c16fd983a..bd5e3c3e1933 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java @@ -53,8 +53,8 @@ public class DatadogProperties extends StepRegistryProperties { private String hostTag = "instance"; /** - * URI to ship metrics to. If you need to publish metrics to an internal proxy - * en-route to Datadog, you can define the location of the proxy with this. + * URI to ship metrics to. Set this if you need to publish metrics to a Datadog site + * other than US, or to an internal proxy en-route to Datadog. */ private String uri = "https://api.datadoghq.com"; diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc index 07e78fd51467..453df62f81f8 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc @@ -132,6 +132,30 @@ To export metrics to {micrometer-registry-docs}/datadog[Datadog], your API key m api-key: "YOUR_KEY" ---- +If you additionally provide an application key (optional), then metadata such as meter descriptions, types, and base units will also be exported: + +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] +---- + management: + metrics: + export: + datadog: + api-key: "YOUR_API_KEY" + application-key: "YOUR_APPLICATION_KEY" +---- + +By default, metrics are sent to the Datadog US https://docs.datadoghq.com/getting_started/site[site] (`https://api.datadoghq.com`). +In case your Datadog project is hosted on one of the other sites, or you need to send metrics through a proxy, change the API base URL accordingly: + +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] +---- + management: + metrics: + export: + datadog: + uri: "https://api.datadoghq.eu" +---- + You can also change the interval at which metrics are sent to Datadog: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] From 3f6fcac683281317b2068e5a221277e404b80263 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 12 May 2022 12:36:50 +0100 Subject: [PATCH 2/2] Polish "Extend documentation on Datadog metrics" See gh-30879 --- .../autoconfigure/metrics/export/datadog/DatadogProperties.java | 2 +- .../spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java index bd5e3c3e1933..4d77107e6a72 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc index 453df62f81f8..2127fdf9f0d5 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc @@ -145,7 +145,7 @@ If you additionally provide an application key (optional), then metadata such as ---- By default, metrics are sent to the Datadog US https://docs.datadoghq.com/getting_started/site[site] (`https://api.datadoghq.com`). -In case your Datadog project is hosted on one of the other sites, or you need to send metrics through a proxy, change the API base URL accordingly: +If your Datadog project is hosted on one of the other sites, or you need to send metrics through a proxy, configure the URI accordingly: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ----