ootel

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 16 Imported by: 1

README

ootel

ootel is an "opinionated" opentelemetry initializer.

Currently the only supported exporters are OTLP gRPC (traces) and Prometheus (metrics)

Documentation

Index

Constants

View Source
const (
	ExporterTypePrometheus = "prometheus"
	ExporterTypeOTLPGRPC   = "otlpgrpc"
	ExporterTypeOTLPHTTP   = "otlphttp"
)

Variables

This section is empty.

Functions

func NewMetricConfig

func NewMetricConfig(enabled bool, exporterType string, serverPort int) *metricConfig

func NewTraceConfig

func NewTraceConfig(enabled bool, sampleRate float64, serviceName, serviceVersion string) *traceConfig

Types

type OotelClient

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

func NewOotelClient

func NewOotelClient(options ...OotelClientOption) *OotelClient

func (*OotelClient) Init

func (oc *OotelClient) Init(ctx context.Context) (func(context.Context) error, error)

type OotelClientOption

type OotelClientOption func(*OotelClient)

func WithMetricConfig

func WithMetricConfig(mc *metricConfig) OotelClientOption

func WithTraceConfig

func WithTraceConfig(tc *traceConfig) OotelClientOption

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳