contrib

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

This package implements integration between the official go mongodb driver (https://github.com/mongodb/mongo-go-driver) and OpenTelemetry.

import "github.com/americanas-go/ignite/go.mongodb.org/mongo-driver.v1/plugins/contrib/opentelemetry/otelmongo.v1

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func Register

func Register(ctx context.Context) (mongo.ClientOptionsPlugin, mongo.ClientPlugin)

Register registers a new opentelemetry plugin on a new mongo client.

Types

type Options

type Options struct {
	Enabled bool
}

Options represents the opentelemetry plugin for mongo options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals a given key path into options and returns it.

type OtelMongo

type OtelMongo struct {
	// contains filtered or unexported fields
}

OtelMongo represents a opentelemetry plugin for mongo.

func NewOtelMongo

func NewOtelMongo() *OtelMongo

NewOtelMongo returns a new opentelemetry plugin with default options.

func NewOtelMongoWithConfigPath

func NewOtelMongoWithConfigPath(path string) (*OtelMongo, error)

NewOtelMongoWithConfigPath returns a new opentelemetry plugin with options from config path.

func NewOtelMongoWithOptions

func NewOtelMongoWithOptions(options *Options) *OtelMongo

NewOtelMongoWithOptions returns a new opentelemetry plugin with options.

func (*OtelMongo) Register

func (d *OtelMongo) Register(ctx context.Context) (mongo.ClientOptionsPlugin, mongo.ClientPlugin)

Register registers this opentelemetry plugin on a new mongo client.

Jump to

Keyboard shortcuts

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