Skip to content

Commit 2173350

Browse files
committed
Merge pull request #30879 from denisw
* gh-30879: Polish "Extend documentation on Datadog metrics" Extend documentation on Datadog metrics Closes gh-30879
2 parents 822aad9 + 3f6fcac commit 2173350

File tree

2 files changed

+27
-3
lines changed
  • spring-boot-project
    • spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog
    • spring-boot-docs/src/docs/asciidoc/actuator

2 files changed

+27
-3
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,8 +53,8 @@ public class DatadogProperties extends StepRegistryProperties {
5353
private String hostTag = "instance";
5454

5555
/**
56-
* URI to ship metrics to. If you need to publish metrics to an internal proxy
57-
* en-route to Datadog, you can define the location of the proxy with this.
56+
* URI to ship metrics to. Set this if you need to publish metrics to a Datadog site
57+
* other than US, or to an internal proxy en-route to Datadog.
5858
*/
5959
private String uri = "https://api.datadoghq.com";
6060

spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,30 @@ To export metrics to {micrometer-registry-docs}/datadog[Datadog], your API key m
132132
api-key: "YOUR_KEY"
133133
----
134134

135+
If you additionally provide an application key (optional), then metadata such as meter descriptions, types, and base units will also be exported:
136+
137+
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
138+
----
139+
management:
140+
metrics:
141+
export:
142+
datadog:
143+
api-key: "YOUR_API_KEY"
144+
application-key: "YOUR_APPLICATION_KEY"
145+
----
146+
147+
By default, metrics are sent to the Datadog US https://docs.datadoghq.com/getting_started/site[site] (`https://api.datadoghq.com`).
148+
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:
149+
150+
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
151+
----
152+
management:
153+
metrics:
154+
export:
155+
datadog:
156+
uri: "https://api.datadoghq.eu"
157+
----
158+
135159
You can also change the interval at which metrics are sent to Datadog:
136160

137161
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]

0 commit comments

Comments
 (0)