honeycomb

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 11

README

OSS Lifecycle Build Status

Honeycomb OpenTelemetry Distro for Go

STATUS: this library is BETA. You're welcome to try it, and let us know your feedback in the issues!

This is Honeycomb's distribution of OpenTelemetry for Go. It makes getting started with OpenTelemetry and Honeycomb easier!

Latest release built with:

Minimum Go Version: 1.20

See the OpenTelemetry SDK's compatability matrix for more information.

Why would I want to use this?

  • Streamlined configuration for sending data to Honeycomb!
  • Easy interop with existing instrumentation with OpenTelemetry!
  • Deterministic sampling!
  • Multi-span attributes!
  • Dynamic attributes!

Where's most of the code?

This package is a layer on top of the core package, which you can find in here. As such, this package only contains Honeycomb-specific functionality.

Our goal is to have the otel-config-go package be donated to the opentelemetry-go-contrib project as a blessed, vendor-neutral way to get started.

License

Apache 2.0 License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string = "0.10.0"
)

Functions

func NewBaggageSpanProcessor

func NewBaggageSpanProcessor() trace.SpanProcessor

Returns a new baggageSpanProcessor.

The Baggage span processor duplicates onto a span the attributes found in Baggage in the parent context at the moment the span is started.

func NewDynamicAttributeSpanProcessor

func NewDynamicAttributeSpanProcessor(setAttributes func() []attribute.KeyValue) trace.SpanProcessor

Returns a new dynamicAttributeSpanProcessor.

Use this span processor when you find yourself wishing for dynamic resource attributes.

Define a function that sets attributes and values for them, then pass that function in as the setAttributes parameter to this constructor. The Dynamic Attribute span processor will call setAttributes whenever a span is started which allows for defining a function once and to have attribute values determined on span start.

func NewSpanLinkExporter added in v0.2.0

func NewSpanLinkExporter(apikey string, serviceName string) (*spanLinkExporter, error)

func WithApiKey

func WithApiKey(apikey string) otelconfig.Option

WithApiKey() sets the authorization header appropriately for sending to Honeycomb's API endpoint.

func WithDataset

func WithDataset(dataset string) otelconfig.Option

WithDataset() sets the header for routing telemetry to a named dataset at Honeycomb. (For trace data in Classic teams and for metrics only.)

func WithDebugSpanExporter

func WithDebugSpanExporter() otelconfig.Option

WithDebugSpanExporter() determines whether a debug (stdout) traces exporter should be configured.

func WithHoneycomb

func WithHoneycomb() otelconfig.Option

WithHoneycomb() sets the destination for traces and metrics to Honeycomb's API endpoint.

func WithMetricsApiKey added in v0.2.0

func WithMetricsApiKey(apikey string) otelconfig.Option

WithMetricsApiKey() sets the authorization header appropriately for sending metrics telemetry to Honeycomb's API endpoint.

func WithMetricsDataset added in v0.2.0

func WithMetricsDataset(dataset string) otelconfig.Option

WithMetricsDataset() sets the header for routing metrics telemetry to a named dataset at Honeycomb.

func WithSampler

func WithSampler(sampleRate int) otelconfig.Option

WithSampler() sets the sampler used to sample trace spans using a Honeycomb sample rate. Sample rate is expressed as 1/X where x is the population size.

func WithTracesApiKey added in v0.2.0

func WithTracesApiKey(apikey string) otelconfig.Option

WithTracesApiKey() sets the authorization header appropriately for sending traces telemetry to Honeycomb's API endpoint.

func WithTracesDataset added in v0.2.0

func WithTracesDataset(dataset string) otelconfig.Option

WithTracesDataset() sets the header for routing traces telemetry to a named dataset at Honeycomb.

Types

type DeterministicSampler

type DeterministicSampler struct {
	// contains filtered or unexported fields
}

func NewDeterministicSampler

func NewDeterministicSampler(sampleRate int) DeterministicSampler

func (DeterministicSampler) Description

func (ds DeterministicSampler) Description() string

func (DeterministicSampler) ShouldSample

Directories

Path Synopsis
examples
baggage Module

Jump to

Keyboard shortcuts

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