telemetry

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggerProvider

func NewLoggerProvider(ctx context.Context, opt *Config) (log.LoggerProvider, func(), error)

func NewMeterProvider

func NewMeterProvider(ctx context.Context, opt *Config) (metric.MeterProvider, http.Handler, func(), error)

func NewTracerProvider

func NewTracerProvider(ctx context.Context, opt *Config) (trace.TracerProvider, func(), error)

Types

type Config

type Config struct {
	ServiceName     string `mapstructure:"serviceName"`
	Environment     string `mapstructure:"environment"`
	GzipCompression bool   `mapstructure:"gzipCompression"`

	Trace   Trace         `mapstructure:"trace"`
	Metrics MetricsConfig `mapstructure:"metrics"`
	Logs    LogsConfig    `mapstructure:"logs"`
}

type Endpoint

type Endpoint struct {
	Endpoint    string `mapstructure:"addr"`
	EndpointURL string `mapstructure:"url"`
}

type ExporterType

type ExporterType string
const (
	ExporterTypePull ExporterType = "pull"
	ExporterTypePush ExporterType = "push"
)

type GRPC

type GRPC struct {
	Endpoint `mapstructure:",squash"`
	Insecure bool `mapstructure:"insecure"`
}

type HTTP

type HTTP struct {
	Endpoint `mapstructure:",squash"`
}

type LogsConfig

type LogsConfig struct {
	Enabled bool  `mapstructure:"enabled"`
	HTTP    *HTTP `mapstructure:"http"`
	GRPC    *GRPC `mapstructure:"grpc"`
}

type MetricsConfig

type MetricsConfig struct {
	Enabled      bool         `mapstructure:"enabled"`
	ExporterType ExporterType `mapstructure:"exporterType"`

	// push 用(ExporterType == "push" の時のみ使用)
	HTTP *HTTP `mapstructure:"http"`
	GRPC *GRPC `mapstructure:"grpc"`
}

type Trace

type Trace struct {
	Enabled bool  `mapstructure:"enabled"`
	HTTP    *HTTP `mapstructure:"http"`
	GRPC    *GRPC `mapstructure:"grpc"`
}

Jump to

Keyboard shortcuts

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