Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.78 KB

find_monitoring.md

File metadata and controls

24 lines (16 loc) · 1.78 KB

How to find monitoring

This guide documents how to find monitoring within Sourcegraph's source code. Sourcegraph employees should also refer to the handbook's monitoring section for Sourcegraph-specific documentation. The developing observability page contains relevant documentation as well.

NOTE: For how to use Sourcegraph's observability and an overview of our observability features, refer to the observability for site administrators documentation.

Alerts

Alerts are defined in the monitoring/definitions package - for example, querying for definitions of Warning or Critical will surface all Sourcegraph alerts.

Metrics

You can use Sourcegraph itself to search for metrics definitions - for example, by querying for usages of prometheus.HistogramOpts.

Sometimes the metrics are hard to find because their name declarations are not literal strings, but are concatenated in code from variables. In these cases you can try a specialized tool called promgrep to find them.

go get github.com/sourcegraph/promgrep
# in the root `sourcegraph/sourcegraph` source directory
promgrep <some_partial_metric_name> # no arguments lists all declared metrics