This module provides a Spring Boot auto-configuration to export actuator metrics to Google Cloud's Stackdriver.
Follow the instructions at JitPack.
The only configuration needed is to set the Spring property
management.metrics.export.stackdriver.project-id
to reference your GCP project's ID.
If running external to a GCP compute resource, refer to the
GCP Monitoring Client documentation
and you will need to generate an authentication key file and pass the path to that via the
environment variable GOOGLE_APPLICATION_CREDENTIALS
.
You will be able to locate your metrics within the Resource Type "Global", as shown here:
The default Stackdriver naming convention prepends your metric's name with "custom/", as shown here:
The metric shown in the example was declared like the following:
@Autowired
public SomeAppService(MeterRegistry meterRegistry) {
messagesPre = meterRegistry.counter("messages", "stage", "pre");
messagesPost = meterRegistry.counter("messages", "stage", "post");
}
Use the Maven release plugin to perform the build, tag, and update
mvn release:prepare
With that completed, git push the commits and tag to the repo.