o11y

package
v1.0.12900-f59cc21 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 16 Imported by: 2

Documentation

Overview

Package o11y is the primary entrypoint for wiring up a standard configuration of the o11y observability system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Otel

Otel is the primary entrypoint to initialize the o11y system for otel.

func Setup

func Setup(ctx context.Context, o Config) (context.Context, func(context.Context), error)

Setup is the primary entrypoint to initialize the o11y system.

Types

type Config

type Config struct {
	Statsd            string
	RollbarToken      secret.String
	RollbarEnv        string
	RollbarServerRoot string
	HoneycombEnabled  bool
	HoneycombDataset  string
	HoneycombHost     string
	HoneycombKey      secret.String
	SampleTraces      bool
	SampleKeyFunc     func(map[string]any) string
	SampleRates       map[string]int
	Format            string
	Version           string
	Service           string
	StatsNamespace    string

	// Optional
	Mode                    string
	Debug                   bool
	RollbarDisabled         bool
	StatsdTelemetryDisabled bool
	Writer                  io.Writer

	// Sender allows setting a custom honeycomb sender, Typically the build-in one is preferred.
	Sender transmission.Sender

	// Metrics allows setting a custom metrics client. Typically setting Statsd/StatsNamespace is preferred
	Metrics o11y.ClosableMetricsProvider
}

func (*Config) OtelSampleRates

func (c *Config) OtelSampleRates() map[string]uint

OtelSampleRates adapts the root o11y package configured map[string]int sample rates to the Otel-required map[string]uint

type OtelConfig

type OtelConfig struct {
	GrpcHostAndPort string

	// HTTPTracesURL configures a host for exporting traces to http[s]://host[:port][/path]
	HTTPTracesURL string

	// HTTPAuthorization is the authorization token to send with http requests
	HTTPAuthorization secret.String

	Dataset string
	// UseEnvironments will cause spans to be sent to the new honeycomb environments
	UseEnvironments bool

	// DisableText prevents output to stdout for noisy services. Ignored if no other no hosts are supplied
	DisableText bool

	Test bool

	SampleTraces  bool
	SampleKeyFunc func(map[string]interface{}) string
	SampleRates   map[string]uint

	Statsd                  string
	StatsNamespace          string
	StatsdTelemetryDisabled bool

	RollbarToken      secret.String
	RollbarEnv        string
	RollbarServerRoot string
	RollbarDisabled   bool

	Version string
	Service string
	Mode    string

	// Metrics allows setting a custom metrics client. Typically, the default Statsd provider is preferred.
	// The provided value will be closed by the cleanup function
	Metrics o11y.ClosableMetricsProvider
}

OtelConfig contains all the things we need to configure for otel based instrumentation.

Jump to

Keyboard shortcuts

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