Documentation
¶
Index ¶
- Variables
- func SetupLogging(ctx context.Context, configuration *LoggerConfiguration, ...) (*log.LoggerProvider, error)
- func SetupMetrics(ctx context.Context, configuration *MeterConfiguration, ...) (*metric.MeterProvider, error)
- func SetupOTelSDK(ctx context.Context, loggerOptions *LoggerConfiguration, ...) (context.Context, func(context.Context) error, error)
- func SetupTracing(ctx context.Context, configuration *TracerConfiguration, ...) (*trace.TracerProvider, error)
- type LoggerConfiguration
- type LoggingMethod
- type MeterConfiguration
- type MetricMethod
- type ShutdownFuncs
- type TracerConfiguration
- type TracingMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigurationRequired = errors.New("configuration not provided")
Functions ¶
func SetupLogging ¶
func SetupLogging( ctx context.Context, configuration *LoggerConfiguration, shutdownFunc *ShutdownFuncs, res *resource.Resource, ) (*log.LoggerProvider, error)
func SetupMetrics ¶
func SetupMetrics( ctx context.Context, configuration *MeterConfiguration, shutdownFuncs *ShutdownFuncs, res *resource.Resource, ) (*metric.MeterProvider, error)
func SetupOTelSDK ¶
func SetupOTelSDK( ctx context.Context, loggerOptions *LoggerConfiguration, meterOptions *MeterConfiguration, tracerOptions *TracerConfiguration, serviceName string, ) (context.Context, func(context.Context) error, error)
setupOTelSDK bootstraps the OpenTelemetry pipeline. If it does not return an error, make sure to call shutdown for proper cleanup.
func SetupTracing ¶
func SetupTracing( ctx context.Context, configuration *TracerConfiguration, shutdownFuncs *ShutdownFuncs, res *resource.Resource, ) (*trace.TracerProvider, error)
Types ¶
type LoggerConfiguration ¶
type LoggerConfiguration struct {
Method LoggingMethod
Stdout []stdoutlog.Option
Grpc []otlploggrpc.Option
Http []otlploghttp.Option
}
type LoggingMethod ¶
type LoggingMethod uint8
const ( LoggingMethodStdout LoggingMethod = iota LoggingMethodGRPC LoggingMethodHTTP )
type MeterConfiguration ¶
type MeterConfiguration struct {
Method MetricMethod
Stdout []stdoutmetric.Option
Grpc []otlpmetricgrpc.Option
Http []otlpmetrichttp.Option
BatchTimer time.Duration
}
type MetricMethod ¶
type MetricMethod uint8
const ( MetricMethodStdout MetricMethod = iota MetricMethodGRPC MetricMethodHTTP )
type ShutdownFuncs ¶
type ShutdownFuncs struct {
// contains filtered or unexported fields
}
ShutdownFuncs consolidates closures from the reference code to enable refactoring the code for clarity.
type TracerConfiguration ¶
type TracerConfiguration struct {
Method TracingMethod
Stdout []stdouttrace.Option
Grpc []otlptracegrpc.Option
Http []otlptracehttp.Option
BatchTimer time.Duration // the delay between batch posts. default is 5s
}
type TracingMethod ¶
type TracingMethod uint8
const ( TracingMethodStdout TracingMethod = iota TracingMethodGRPC TracingMethodHTTP )
Click to show internal directories.
Click to hide internal directories.