Note
This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.
This repository contains code samples demonstrating how to instrument applications using OpenTelemetry and export the telemetry data to Google Cloud Observability.
OpenTelemetry is a collection of tools, APIs, and SDKs used to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software's performance and behavior.
This project provides practical examples across multiple programming languages to help you get started with OpenTelemetry on Google Cloud.
- java: Java samples.
- autoconf-auth-extension: Example showing OTLP exporter with GCP Auth Extension for traces and metrics.
- instrumentation-quickstart: OpenTelemetry Spring Boot auto-instrumentation quickstart using the Java Agent and OTel Collector.
- otlp-spring: Example showcasing OTLP trace ingest on GCP and Google Auth in a Spring Boot App.
- otlpiap: Example showing OTLP exporter sending telemetry to a Cloud Run collector behind IAP.
- otlpmetric: Example for OTLP Metric exporter.
- otlpmetrics-function: Example showing how to export OpenTelemetry metrics from a Google Cloud Run Function to Google Managed Prometheus using OpenTelemetry Collector running as a sidecar.
- otlptrace: Example showing OTLP exporter being used for traces export to GCP.
- resource: Examples for showing resource detection in various GCP environments.
- golang: Go samples.
- metric/otlpgrpc: Example for OTLP Metric exporter via gRPC.
- trace/otlpgrpc: Example showing OTLP exporter being used for traces export to GCP via gRPC.
- trace/otlphttp: Example showing OTLP exporter being used for traces export to GCP via HTTP.
- javascript: JavaScript samples.
- instrumentation-quickstart: OpenTelemetry Node.js auto-instrumentation quickstart using Fastify and OTel Collector.
- otlpmetricexport: Example showing OTLP Metric exporter via gRPC.
- otlptraceexport: Example showing OTLP exporter being used for traces export to GCP using gRPC or HTTP.
- python: Python samples.
- adk-sql-agent: Example showing ADK SQL Agent sample instrumented with OpenTelemetry.
- instrumentation-quickstart: OpenTelemetry Python auto-instrumentation quickstart using Flask and OTel Collector.
- langgraph-sql-agent: Example showing LangGraph SQL Agent sample instrumented with OpenTelemetry.
- otlpmetric: Example for OTLP Metric exporter.
- otlptrace: Example showing OTLP exporter being used for traces export to GCP.