Before you begin
Follow the checklist to ensure that your application is generating metrics, traces, and exemplars.
- Verify that your application is using the official Prometheus client libraries.
- Ensure that the client library you choose is emitting metrics in OpenMetrics format by referencing its documentation. For the Prometheus Go client library, for example, this requires you to set
EnableOpenMetrics
totrue
. For the Java library, follow its instructions on setting the proper header format. - Obtain the trace ID for the current request and include the trace ID in calls to emit metrics.
- For histograms, use the
ObserveWithExemplar
method to emit the trace ID along with a value for the histogram. These functions are from the Go library but you can find similar functions in the other libraries. - For counters, use the
AddWithExemplar
method to emit the trace ID along with a counter increment.
- For histograms, use the
- Verify that metrics are being generated with exemplars by running the following command in a shell:
curl -H "Accept: application/openmetrics-text" http://<your application>/metrics | grep -i "traceid"
.
See also:
Related Grafana Cloud resources
Intro to Prometheus and Grafana Cloud
Prometheus is taking over the monitoring world! In this webinar, we will start with a quick introduction to the open source project that’s the de facto standard for monitoring modern, cloud native systems.
How to set up and visualize synthetic monitoring at scale with Grafana Cloud
Learn how to use Kubernetes, Grafana Loki, and Grafana Cloud’s synthetic monitoring feature to set up your infrastructure's checks in this GrafanaCONline session.
Using Grafana Cloud to drive manufacturing plant efficiency
This GrafanaCONline session tells how Grafana helps a 75-year-old manufacturing company with product quality and equipment maintenance.