Created
January 30, 2019 16:06
-
-
Save jkschneider/796471c7a0b28b6076584e179b333019 to your computer and use it in GitHub Desktop.
Wiring for Datadog in Spring MVC
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
@Bean | |
MeterRegistry registry() { | |
MeterRegistry registry = new DatadogMeterRegistry(new DatadogConfig() { | |
@Override | |
public String apiKey() { | |
return ""; | |
} | |
@Override | |
public String applicationKey() { | |
return ""; | |
} | |
@Override | |
public String get(String key) { | |
return System.getProperty(key); | |
} | |
}, Clock.SYSTEM); | |
new JvmGcMetrics().bindTo(registry); | |
new ProcessorMetrics().bindTo(registry); | |
return registry; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're responsible for instrumenting HTTP endpoints yourself using this model. You can refer to this filter which is how Spring Boot does it, and recreate it as necessary.