Skip to content

hsojod/otel-spanner-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTelemetry Spanner Sample Application

This is a sample application demonstrating a bug in the OpenTelemetry instrumentation with Cloud Spanner using the Spanner emulator.

Prerequisites

Setup

  1. Start the Spanner emulator:
docker pull gcr.io/cloud-spanner-emulator/emulator
docker run -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator
  1. Install dependencies:
npm install
  1. Start the application:
npm start

Example Usage

Basic query example:

curl http://localhost:8080/

Tracing

The application is instrumented with OpenTelemetry Node SDK and outputs traces to the console. Each request will generate a trace with multiple spans showing the Spanner operations.

Example trace output:

{
  "traceId": "abc123...",
  "spanId": "def456...",
  "name": "CloudSpanner.executeStreamingSql",
  "attributes": {
    "db.system": "spanner",
    "db.name": "otel-spanner-test-database"
  }
}

Environment Variables

  • PORT - Server port (default: 8080)

Notes

This application uses the Spanner emulator for local development. For production use, you'll need to configure actual Google Cloud credentials and update the Spanner connection settings.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors