This repo is a sample Spring Boot app that demonstrates OpenTelemetry metrics in Translate
This repo is dependent on the branch otel-poc of gax. see relevant changes in gax
- Enable Cloud Monitoring API and Translate API
- Go to the root folder of
sdk-platform-java, switch to branchotel-poc, runmvn clean install -DskipTests -Dcheckstyle.skip -Dclirr.skip. - Replace the project id in application.properties to your own project id.
- Start the app
- Navigate to http://localhost:8080/translate/hello for a few requests
- Wait up to 1 minute, the metrics should show up in Cloud Monitoring dashboard on Metrics explorer tab. The relevant metrics are under Generic Task -> Custom metrics -> attempt_latency
- Alternatively, navigate to http://localhost:9090 to see the latest metrics without waiting.