opentelemetry

command module
v0.0.0-...-b005dc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: BSD-2-Clause Imports: 12 Imported by: 0

README

Example for Bun's OpenTelemetry instrumentation

This example demonstrates how to monitor Bun SQL client using OpenTelemetry and Uptrace. It requires Docker to start PostgreSQL and Uptrace.

See SQL performance and errors monitoring for details.

Step 1. Download the example using Git:

git clone https://github.com/uptrace/bun.git
cd example/opentelemetry

Step 2. Start the services using Docker:

docker-compose pull
docker-compose up -d

Step 3. Make sure Uptrace is running:

docker-compose logs uptrace

Step 4. Run the Bun client example:

UPTRACE_DSN=http://project2_secret_token@localhost:14317/2 go run client.go

Step 5. Follow the link from the CLI to view the trace:

UPTRACE_DSN=http://project2_secret_token@localhost:14318?grpc=14317 go run client.go
trace: http://localhost:14318/traces/ee029d8782242c8ed38b16d961093b35

Bun trace

You can also open Uptrace UI at http://localhost:14318 to view available spans, logs, and metrics.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL