Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
Setup configures logging, tracing, and metrics otel configurations, including setting the global instances of logging, tracing, and metrics providers. Setup should be called exactly once at startup.
By default traces are ignored and logs are simply forwarded to stdout.
If `OTLP_DIR` is set, traces and logs will be written to a jsonnl file in the specified directory. (Paths are relative to the binary's working dir)
if `OTLP_GRPC` is set, traces and logs will be sent via the OTLP gRPC exporter to the specified endpoint.
Configuration options can also be passed via With* helpers.
See [config.fromEnv] for more details.
Types ¶
type Option ¶
type Option func(c config) config
Option customizes the behavior of Setup. Options are applied in order when calling Setup.
func WithBinaryName ¶
WithBinaryName sets the binary name used for file output naming.
func WithGRPCEndpoint ¶
WithGRPCEndpoint sets the OTLP gRPC endpoint.
func WithLogLevel ¶
func WithLogLevel(level log.TypedLevel) Option
WithLogLevel sets the logging level.
func WithMetricsInterval ¶
WithMetricsInterval sets the interval for metric collection/export.
func WithServiceName ¶
WithServiceName sets the OTEL service name for logs, traces, and metrics.
func WithTraceOutputDirectory ¶
WithTraceOutputDirectory sets the directory where logs, traces, and metrics are written.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package otelkube provides a client.Client and functions to propagate otel spans, traces, and baggage via Annotations on Kubernetes resources.
|
Package otelkube provides a client.Client and functions to propagate otel spans, traces, and baggage via Annotations on Kubernetes resources. |