Documentation ¶
Overview ¶
Package cobraotel implements a builder for registering flags and producing a Cobra RunFunc that configures OpenTelemetry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is used to configure OpenTelemetry via Cobra.
func (*Builder) RegisterFlagCompletion ¶
RegisterFlagCompletion adds completion functions supported flags.
The following flags are completed: - "$PREFIX-provider" - "$PREFIX-trace-propagator"
func (*Builder) RegisterFlags ¶
RegisterFlags adds flags for configuring OpenTelemetry.
The following flags are added: - "$PREFIX-provider" - "$PREFIX-trace-propagator" - "$PREFIX-insecure" - "$PREFIX-endpoint" - "$PREFIX-service-name"
type Option ¶
type Option func(*Builder)
Option is function used to configure OpenTelemetry within a Cobra RunFunc.
func WithFlagPrefix ¶
WithFlagPrefix defines prefix used with the generated flags.
Defaults to "log".
func WithLogger ¶
WithLogger configures logging of the configured OpenTelemetry environment.
func WithPreRunLevel ¶
WithPreRunLevel defines the logging level used for pre-run log messages.
Defaults to "debug".