Skip to content

Prometheus metrics

Craig Furman requested to merge craigf/prometheus-metrics into master

Add route to HTTP request events

This will be useful for labelling metrics by route. If we were to label by path, a troll spamming us on random paths could lead to a label cardinality explosion.

Change instrumentation.Event to a map

So that we can pull individual values out of it, to use as prometheus metric labels.

This is a bit of a pain as references to its pointer all have to be replaced, because maps are already pointers internally.

Note that this causes key-value pairs to appear in random order in logs, due to golang map ordering. I don't think this is a big problem, and won't matter at all if viewing the logs in kibana.

HTTP request prometheus metrics

Prometheus metrics for async jobs


Related: https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11487

I'd recommend reviewing this one commit at a time.

Edited by Craig Furman

Merge request reports