- How did response time change after scaling up my Cloud Run services?
- What is the error rate for my Pub/Sub topics?
- How does application performance vary across GCP regions?
- Are application errors happening in specific services, or across the entire environment?
- Are there any performance bottlenecks in my Cloud SQL or Firestore operations?
Before you begin
Before you begin, make sure you have:- A Google Cloud account with appropriate admin privileges
- Access to a GCP project you want to monitor
- A Honeycomb Ingest API Key
Choosing a collector distribution
Your first decision is which collector distribution to use:- OpenTelemetry Collector Contrib: The community-maintained distribution that includes GCP receivers. This is the recommended starting point if you are already using OpenTelemetry across your stack or want a single collector for multiple environments.
- Google’s collector distribution: Google’s own build, optimized for GCP environments. Consider this if you are running entirely on GCP and want tighter integration with Google’s deployment tooling.
- Custom collector: Build your own binary with only the components you need. Include only the components that match the GCP services you want to monitor:
builder-config.yaml to build a custom collector with the GCP components you need:
Deploying an OpenTelemetry Collector
Deploy your collector in the same GCP environment as the services you want to monitor. This minimizes network latency and simplifies authentication using GCP’s built-in identity mechanisms. Google Cloud offers deployment guides for several environments. These guides focus on the Google-built OpenTelemetry Collector, but you can adapt them for other distributions. Follow the guide for your environment:- Deploy on Google Kubernetes Engine
- Deploy on Container-Optimized OS
- Deploy on Cloud Run
- Deploy on Compute Engine
Collecting Google Cloud Run function metrics
The Google Cloud Monitoring Receiver pulls metrics from the Cloud Monitoring API on a schedule, making it useful for infrastructure-level data like instance counts, execution times, and memory usage. The receiver accepts a list of metric names; to explore available metrics, visit Google’s Cloud Monitoring documentation. This example configuration collects Google Cloud Run function metrics:Collecting traces, logs, and metrics from Google Pub/Sub
Pub/Sub is a natural integration point for telemetry in GCP because many services can publish to a topic, and the receiver handles consuming and forwarding that data without additional configuration overhead. Use the Google Pub/Sub Receiver to collect telemetry from a Google Pub/Sub subscription. The following example configuration collects telemetry from a Pub/Sub subscription:Collecting database metrics from Google Cloud Spanner
The Spanner Receiver collects query and transaction metrics directly from Spanner’s built-in statistics tables, giving you visibility into slow queries, lock contention, and data volume without requiring application-level instrumentation. Use the Google Cloud Spanner Receiver to collect query, transaction, and other metrics from your databases. The following example configuration collects metrics from two Spanner instances across a single project:Exporting telemetry to Honeycomb
Once your receivers are configured, add an OTLP exporter to send your GCP telemetry to Honeycomb. Use the endpoint that matches the region where your Honeycomb data is stored. Configure an OTLP exporter with your Honeycomb Ingest API Key as a header:x-honeycomb-dataset header: