Last active
January 22, 2020 10:04
-
-
Save qyf404/dae4836dc980157c0cec461560f5866f to your computer and use it in GitHub Desktop.
给spring-boot 2.0的项目增加datadog监控
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 这是个可选项, 用来添加一些自定义tag | |
*/ | |
@Bean | |
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(RcConfig rcConfig) { | |
return registry -> registry.config() | |
.commonTags("appname", "myapp", | |
"nodename", "007"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
management: | |
metrics.export.datadog: | |
apiKey: ${your_datadog_key} | |
enabled: true | |
hostTag: ${your_host_name} | |
step: 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> | |
<version>2.2.2.RELEASE</version> | |
<relativePath/> <!-- lookup parent from repository --> | |
</parent> | |
<dependencies> | |
<dependency> | |
<groupId>io.micrometer</groupId> | |
<artifactId>micrometer-registry-datadog</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-actuator</artifactId> | |
</dependency> | |
</dependencies> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment