Sourcegraph DocsSourcegraph Docs
  • Code Intelligence

    • Cody
    • Code Search
  • Code Management

    • Batch Changes
    • Code Navigation
    • Code Monitoring
    • Code Ownership
    • Code Insights
    • Notebooks
  • Platform

    • Sourcegraph Admin
    • Sourcegraph Cloud
    • Integrations
    • Development
  • CLI & API

    • Sourcegraph CLI
    • Sourcegraph GraphQL API
    • Sourcegraph Stream API
  • Help & Support

    • SLAs & Premium Support
    • Tutorials
    • Sourcegraph Accounts
    • Changelog
  1. Docs
  2. dev
  3. how-to
  4. find_monitoring

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

On this page

  1. How to find monitoring

    1. Alerts
    1. Metrics