mongo-driver

command module
v0.0.0-...-00c83e7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: BSD-2-Clause Imports: 9 Imported by: 0

README

mongo-driver OpenTelemetry instrumentation example

PkgGoDev

Quickstart

Install otelmongo instrumentation:

go get go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo

Then add OpenTelemetry monitor:

opt := options.Client()
opt.Monitor = otelmongo.NewMonitor("service-name")

Example

To run this example you need a MongoDB server. You can start one with Docker:

docker-compose up -d

Then run the example:

UPTRACE_DSN="https://<token>@api.uptrace.dev/<project_id>" go run .

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