otelx

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package otelx provides configuration options for various OpenTelemetry integrations.

Index

Constants

View Source
const (
	StdOutProvider   = "stdout"
	OTLPHTTPProvider = "otlphttp"
	OTLPGRPCProvider = "otlpgrpc"
)

Variables

View Source
var (
	ErrUnknownProvider = errors.New("unknown provider")
	ErrInvalidConfig   = errors.New("failed parsing trace config(s)")
)

Functions

func NewTracer

func NewTracer(c Config, name string, logger *zap.SugaredLogger) error

Types

type Config

type Config struct {
	Enabled     bool   `yaml:"enabled" split_words:"true" default:"false"`
	Provider    string `yaml:"provider" split_words:"true" default:"stdout"`
	Environment string `yaml:"environment" split_words:"true" default:"development"`
	StdOut      StdOut
	OTLP        OTLP
}

type OTLP

type OTLP struct {
	Endpoint    string        `yaml:"endpoint" split_words:"true" default:"localhost:4317"`
	Insecure    bool          `yaml:"insecure" split_words:"true" default:"true"`
	Certificate string        `yaml:"certificate" split_words:"true" default:""`
	Headers     []string      `yaml:"headers" split_words:"true" default:""`
	Compression string        `yaml:"compression" split_words:"true" default:""`
	Timeout     time.Duration `yaml:"timeout" split_words:"true" default:"10s"`
}

type StdOut

type StdOut struct {
	Pretty           bool `yaml:"pretty" split_words:"true" default:"true"`
	DisableTimestamp bool `yaml:"disable_timestamp" split_words:"true" default:"false"`
}

Jump to

Keyboard shortcuts

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