Observability
All off-chain systems are by default observable and configured through the metrics package. The observability stack is built around open telemetry with metrics also being exported using this standard.
"Metrics" themselves are divided into 3 different types of metrics:
- Traces: These are used to trace the flow of a request through the system. Our code uses traces for all sorts of events, from the start of a request to the end of a request. Traces are used to debug and profile the system. Traces are made up of spans, which are individual events that occur during the lifetime of a trace. Traces are aggregated ex-post facto by observability solutions. Please see this article for a good overview.
- Metrics: Metrics consist of things like gauges, counters, and histograms. These are used to monitor the health of the system. Metrics are aggregated in real-time by observability solutions. Please see this article for a good overview. We use the Prometheus exporter for metrics and by default make them available on
METRICS_PORT
atMETRICS_PATH
. - APM (Application Performance Monitoring): APM is a combination of traces and metrics. It is used to monitor the performance of the system. We use Pyroscope for APM and by default make it available on
PYROSCOPE_ENDPOINT
.
tip
Sanguine is an open-source repo and tries to be as unopinionated as possible when it comes to which libraries it uses for observability. If you're interested in maintaining an unsupported module as part of the metrics package, pull requests are always welcome!
Configuring Observability
Configuring Tracing:
- Pick a vendor that supports the OTLP standard. We recommend Signoz for OSS.
- Set the
METRICS_HANDLER
environment variable toOTLP
. If you're using a legacy jaeger instance, you can also useJAEGER
- Set the
OTLP_ENDPOINT
environment variable to the endpoint of your observability solution.
Configuring Metrics
- Pick a vendor that supports the prometheus standard. We recommend Grafana for OSS.
- Set the
METRICS_PORT_ENABLED
environment variable totrue
to enable the metrics endpoint. - Find your metrics on
METRICS_PORT
atMETRICS_PATH
and configure scrapers.
Configuring APM
Set the PYROSCOPE_ENDPOINT
environment variable to the endpoint of your pyroscope instance.