Skip to content

Adding Prometheus Metrics to the HTTP Requests

Omar Qunsul requested to merge 17-initial-prometheus-metrics into main

Addressing: #17 (closed)

Adding Prometheus Metrics to the Topology Service - HTTP/REST Server

Context

For Cells Phase 3.1, the Topology Service will receive HTTP Calls from the HTTP Router. This MR adds tracking for these HTTP/REST calls using the in-house developed Go Package labkit.

This MR also add handler for the /metrics endpoint, so that it responds with those Prometheus Metrics. See the steps for validation.

Note

Since the relevant issue is for Phase 3, this is only targeting REST endpoints. For Phase 5, I will create an issue for GRPC endpoints. But labkit doesn't provide any GRPC related helpers for Prometheus. So we have to implement this differently, or see if/how Gitaly does that.

Steps to validate

  1. Make sure you have topology service enabled in your gdk.yml
gitlab_topology_service:
  auto_update: true
  enabled: true

And run gdk reconfigure if you enable it now.

  1. at the GDK root, cd gitlab-topology-service, then switch to this branch 17-initial-prometheus-metrics
  2. Compile using make and restart TS gdk restart gitlab-topology-service
  3. Run curl http://127.0.0.1:9096/metrics. You should get statistics for the REST calls
Edited by Omar Qunsul

Merge request reports

Loading