Sourcegraph Cloud observability
We provide some tooling to make Sourcegraph Cloud easier to monitor and observe. This includes observability for relevant critical infrastructure such as CI/CD pipeline.
For general observability development, please refer to the observability development documentation instead, which includes links to useful how-to guides.
Built-in dashboards
To view metrics, built-in Grafana dashboards are available in https://sourcegraph.com/-/debug/grafana. Learn about how these dashboards in the Grafana documentation.
WARNING: These are only available to site admins on Cloud - see Metrics.
Grafana Cloud
We have a Grafana Cloud instance at sourcegraph.grafana.net. Accounts are automatically provisioned by logging in with GSuite oAuth. Quick links:
Logs
Logs in Grafana Cloud is provided by Grafana Loki, a logs aggregation system that uses a PromQL-like query language called LogQL.
Loki allows you to easily query for logs, filter for fields within structured logs, and even generate metrics from logs. The official LogQL documentation provides a complete reference, or you can refer to this cheatsheet for a brief overview.
Cloud logs
The Loki instance in Grafana Cloud is currently configured to ingest logs from Sourcegraph Cloud pushed from grafana-agent
’s Loki configuration. To query these, you can start with a LogQL query like:
{deploy="sourcegraph",app="sourcegraph-frontend"}
| logfmt
| lvl="warn"
CI logs
The sourcegraph/sourcegraph
CI pipeline also uploads pipeline logs using sg
to Loki. To query these, you can start with a LogQL query like:
{app="buildkite",branch="main",state="failed"}
|~ "FAILED:"
Also refer to the CI dashboard for more examples—just select a panel and click “Explore” to see the underlying query.
Metrics
Metrics are not yet available in Grafana Cloud. We are currently investigating avenues for making these dashboards available without requiring site admin access: sourcegraph/sourcegraph#25407