VPC Metrics
Overview
This document provides a detailed walkthrough on how to send Serverless VPC Access Connector metrics to SigNoz. By the end of this guide, you will have a setup that sends your VPC access metrics to SigNoz.
Here's a quick summary of what we will be doing in this guide
- Create Serverless VPC Access Connector
- Create and configure Compute Engine VM instance to deploy OpenTelemetry Collector
- Deploy OpenTelemetry Collector to fetch the metrics from Google Cloud Monitoring
- Send and Visualize the metrics in SigNoz Cloud
Prerequisites
- Google Cloud account with administrative privilege, or Serverless VPC Access Admin and Compute Engine Admin privilege. You might also require access to create Cloud Function in case you are following the tutorial to create Serverless VPC Connector.
- SigNoz Cloud Account (we are using SigNoz Cloud for this demonstration, we will also need ingestion details. To get your Ingestion Key and Ingestion URL, sign-in to your SigNoz Cloud Account and go to Settings >> Ingestion Settings)
- Access to a project in GCP
Setup
Create Serverless VPC Access Connector
Follow the Creating Serverless VPC Access Connector document to create the serverless VPC access connector.
Deploy OpenTelemetry Collector to fetch the metrics from Google Cloud Monitoring
You will need a Compute Engine instance to install OpenTelemetry Collector. You can follow the instructions on the Creating Compute Engine document to create the Compute Engine instance.
Step 1: Install and configure OpenTelemetry for scraping the metrics from GCP Serverless VPC Access Connector. Follow OpenTelemetry Binary Usage in Virtual Machine guide for detailed instructions.
Note that googlecloudmonitoring
receiver is supported only from version 0.112.0 and above of opentelemetry-collector. So, ensure you download and use the appropriate release.
Step 2: Create config.yaml
.
Under the googlecloudmonitoring
receiver, you need to specify the metrics that you want to capture in the metrics_list
. You can include all the metrics that you would like to capture from Serverless VPC Access Connector, see the available metrics for Serverless VPC Access Connector.
Here is the config.yaml
file for capturing Serverless VPC Access Connector metrics:
receivers:
googlecloudmonitoring:
collection_interval: 5m # Can be specified in seconds (s), minutes (m), or hours (h)
project_id: gcp-project-id
metrics_list:
- metric_name: "vpcaccess.googleapis.com/connector/cpu/utilizations"
- metric_name: "vpcaccess.googleapis.com/connector/instances"
- metric_name: "vpcaccess.googleapis.com/connector/received_bytes_count"
- metric_name: "vpcaccess.googleapis.com/connector/received_packets_count"
- metric_name: "vpcaccess.googleapis.com/connector/sent_bytes_count"
- metric_name: "vpcaccess.googleapis.com/connector/sent_packets_count"
processors:
resource/env:
attributes:
- key: deployment.environment
value: prod
action: upsert
batch: {}
exporters:
otlp:
endpoint: "ingest.{region}.signoz.cloud:443"
tls:
insecure: false
headers:
"signoz-ingestion-key": "<SIGNOZ_INGESTION_KEY>"
service:
pipelines:
metrics:
receivers: [googlecloudmonitoring]
processors: [resource/env,batch]
exporters: [otlp]
Depending on the choice of your region for SigNoz cloud, the otlp endpoint will vary according to this table.
Region | Endpoint |
---|---|
US | ingest.us.signoz.cloud:443 |
IN | ingest.in.signoz.cloud:443 |
EU | ingest.eu.signoz.cloud:443 |
After successful configuration start the OpenTelemetry Collector using following command:
./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$!" > otel-pid
Step 3: If the configurations are configured correctly, you can see the output logs from OpenTelemtry as follows:
Send and Visualize the metrics obtained by OpenTelemetry in SigNoz
Step 1: Go to the SigNoz Cloud URL and head over to the dashboard.
Step 2: If not already created, create a new dashboard. You can create the dashboard and multiple panel under it by following the instructions here.
Step 3: Select metric for Serverless VPC Access Connector
All metrics starting with vpcaccess_googleapis_com_
have been collected from Serverless VPC Access Connector.
For example vpcaccess_googleapis_com_connector_instances
is one of the metrics that was collected.
Troubleshooting
If you run into any problems while setting up monitoring for your Serverless VPC Access Connector metrics with SigNoz, consider these troubleshooting steps:
- Verify Configuration: Double-check your
config.yaml
file to ensure all settings, including the ingestion key and endpoint, are correct. - Review Logs: Look at the logs of the OpenTelemetry Collector to identify any error messages or warnings that might provide insights into what’s going wrong.
- Update Dependencies: Ensure all relevant packages and dependencies are up-to-date to avoid compatibility issues.
- Consult Documentation: Review the SigNoz and OpenTelemetry documentation for any additional troubleshooting of the common issues.