This document offers information about telemetry signals such as metrics, logs, traces, and statistics that are captured for Spanner.
Spanner generates observability data, including metrics, logs, traces, and statistics. You can set up capturing for some signals that are not captured. You can use these signals to get a complete picture of how your system is performing.
Spanner metrics
Metrics are numeric data about database health or performance, such as request latency or CPU utilization, that you measure at regular intervals over time.
Cloud Monitoring regularly measures your service and usage of the Google Cloud resources. To view all the server-side and client-side metrics collected by Spanner, see Metrics list.
Spanner also offers custom client-side metrics that you can set up using OpenTelemetry or OpenCensus with an exporter.
Custom client-side metrics can incur charges through your observability backend. For example, if you use Cloud Monitoring as your backend, you are billed according to Cloud Monitoring pricing.
Spanner logs
A log is a generated record of system activity over time. Each log is a collection of time-stamped log entries, and each log entry describes an event at a specific point in time. For more information about enabling logs, see Enable Data Access audit logs. Cloud Logging collects logging data from common application components. For a list of log types collected by Spanner, see Spanner audit logs.
Spanner traces
Traces represent the path of a request through your application. Traces let you follow the flow of a request and help you to identify the root cause of an issue. You can configure Spanner client libraries to export client-side and server-side traces using OpenTelemetry APIs. For more information about trace collection using OpenTelemetry, see Trace collection overview.
Spanner statistics tables
Spanner offers a set of built-in statistic tables that you can query to gain more information about the following:
- Queries
- Reads
- Transactions
- Locks
- Table sizes
- Table operations
For more information about the available tables, see Spanner built-in statistics tables overview.
What's next
- Spanner metrics list
- Client-side metrics overview
- Capture custom client-side metrics using OpenTelemetry
- Set up trace collection using OpenTelemetry
- Spanner built-in statistics tables overview
- OpenTelemetry documentation