Adding Prometheus Metrics to the HTTP Requests
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
- 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.
- at the GDK root,
cd gitlab-topology-service
, then switch to this branch17-initial-prometheus-metrics
- Compile using
make
and restart TSgdk restart gitlab-topology-service
- Run
curl http://127.0.0.1:9096/metrics
. You should get statistics for the REST calls
Edited by Omar Qunsul