Back to course

Metrics with Prometheus

Go (Golang) for Cloud-Native Microservices

Measuring Everything

You cannot manage what you cannot measure. Prometheus is the standard for cloud-native metrics.

  1. Use the prometheus/client_golang library.
  2. Define counters for HTTP requests.
  3. Expose the /metrics endpoint.

go var httpRequestsTotal = prometheus.NewCounter(prometheus.CounterOpts{...})