observability

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

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 MeterConfig struct {
	CollectPeriod    time.Duration
	ServiceName      string
	ServiceNamespace string
	ServiceVersion   string
}

type TracingConfig

type TracingConfig struct {
	Probability float64
	ServiceName string
}

TracingConfig is the minimum configuration needed to configure any of the tracing solutions that aren't the no-op tracer.

Jump to

Keyboard shortcuts

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