krzko / gcp-cloud-trace-otel

☁️ Google Cloud Trace to OpenTelemetry exporter tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gcp-cloud-trace-otel

In Google Cloud Platform (GCP), Load Balancers play a crucial role in distributing incoming traffic across backend instances to ensure high availability and reliability of your services. However, when GCP Load Balancers handle the initial request from a client, a unique challenge arises regarding trace export.

GCP Load Balancers are responsible for creating the initial request span. This root span, which represents the entire lifecycle of a request, is created within the Load Balancer itself. Unfortunately, due to the architectural design of GCP Load Balancers, this root span cannot be directly exported to external observability platforms, except to Google BigQuery.

This tool is a Proof of Concept (PoC) as to how one could export the root span into native OpenTelemetry Protocol (OTLP) format.

Getting Started

  1. Clone the repository to your local machine:
git clone https://github.com/yourusername/gcp-cloud-trace-otel-converter.git
  1. Build the tool:
cd gcp-cloud-trace-otel-converter
go build
  1. Authenticate to Google Cloud
gcloud auth login --update-ad
  1. Export credentials
export GOOGLE_CREDENTIALS=$(cat /Users/${USER}/.config/gcloud/application_default_credentials.json)
export GOOGLE_APPLICATION_CREDENTIALS=/Users/${USER}/.config/gcloud/application_default_credentials.json
  1. Export your OTLP endpoint
export OTEL_EXPORTER_OTLP_ENDPOINT="localhost:4317"
  1. Run the tool
./gcp-cloud-trace-otel --project_id=foo-bar-dev-1a2b3c

About

☁️ Google Cloud Trace to OpenTelemetry exporter tool


Languages

Language:Go 100.0%