Documentation ¶
Index ¶
- func GrpcConnection(ctx context.Context, endpoint string, tlsConfigs ...*tls.Config) (*grpc.ClientConn, error)
- func HoneycombTracer(ctx context.Context, conn *grpc.ClientConn, config HoneycombTracingConfig) (*trace.TracerProvider, error)
- func NewTimer() *timer
- func NoopTracer() (*trace.TracerProvider, error)
- func OtelMeter(ctx context.Context, conn *grpc.ClientConn, meterConfig MeterConfig) (func(context.Context) error, error)
- func OtelTracer(ctx context.Context, conn *grpc.ClientConn, config TracingConfig) (*trace.TracerProvider, error)
- type HoneycombTracingConfig
- type MeterConfig
- type TracingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GrpcConnection ¶
func GrpcConnection(ctx context.Context, endpoint string, tlsConfigs ...*tls.Config) (*grpc.ClientConn, error)
GrpcConnection returns a configured connection to the collector on the specified endpoint. That connection can then be used for both metrics and tracing setup.
func HoneycombTracer ¶
func HoneycombTracer(ctx context.Context, conn *grpc.ClientConn, config HoneycombTracingConfig) (*trace.TracerProvider, error)
HoneycombTracer returns a tracer provider configured to send traces to your Honeycomb account.
func NewTimer ¶
func NewTimer() *timer
NewTimer returns a pointer to a timer instance with the start time set as the creation date.
func NoopTracer ¶
func NoopTracer() (*trace.TracerProvider, error)
NoopTracer returns a non-configured empty trace provider that won't do anything.
func OtelMeter ¶
func OtelMeter(ctx context.Context, conn *grpc.ClientConn, meterConfig MeterConfig) (func(context.Context) error, error)
OtelMeter takes a grpc connection to an otel collector, a MeterConfig that holds important data like collection period, service and namespace names, and the version of the application we're attaching the meter to. It then configures the meter provider, and returns a shutdown function and nil error if successful.
This function merely sets up the scaffolding to ship collected metered data to the opentelemetry collector. It does not set up the specific meters for the applications.
func OtelTracer ¶
func OtelTracer(ctx context.Context, conn *grpc.ClientConn, config TracingConfig) (*trace.TracerProvider, error)
OtelTracer sets up a trace provider that sends data to an opentelemetry collector.
Types ¶
type HoneycombTracingConfig ¶
type HoneycombTracingConfig struct { TracingConfig APIKey string Dataset string }
HoneycombTracingConfig embeds the TracingConfig struct, and adds other, specifically Honeycomb related fields.
type MeterConfig ¶
type TracingConfig ¶
TracingConfig is the minimum configuration needed to configure any of the tracing solutions that aren't the no-op tracer.