honeycomb

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Overview

Package honeycomb contains a trace exporter for Honeycomb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OCProtoSpanToOTelSpanSnapshot added in v0.16.0

func OCProtoSpanToOTelSpanSnapshot(span *tracepb.Span) (*trace.SpanSnapshot, error)

OCProtoSpanToOTelSpanSnapshot converts an OC Span to an OTel SpanSnapshot

Types

type Config

type Config struct {
	// APIKey is your Honeycomb authentication token, available from
	// https://ui.honeycomb.io/account. This API key must have permission to
	// send events.
	//
	// Don't have a Honeycomb account? Sign up at https://ui.honeycomb.io/signup.
	APIKey string
}

Config defines the basic configuration for the Honeycomb exporter.

type Exporter

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

Exporter is an implementation of trace.Exporter that uploads a span to Honeycomb.

func NewExporter

func NewExporter(config Config, opts ...ExporterOption) (*Exporter, error)

NewExporter returns an implementation of trace.Exporter that uploads spans to Honeycomb.

func (*Exporter) ExportSpans added in v0.12.0

func (e *Exporter) ExportSpans(ctx context.Context, sds []*trace.SpanSnapshot) error

ExportSpans exports a sequence of OpenTelemetry spans to Honeycomb.

func (*Exporter) RunErrorLogger added in v0.4.3

func (e *Exporter) RunErrorLogger(ctx context.Context)

RunErrorLogger consumes from the response queue, calling the onError callback when errors are encountered.

This method will block until the passed context.Context is canceled, or until exporter.Close is called.

func (*Exporter) Shutdown added in v0.12.0

func (e *Exporter) Shutdown(ctx context.Context) error

Shutdown waits for all in-flight messages to be sent. You should call Shutdoown() before app termination.

type ExporterOption added in v0.2.3

type ExporterOption func(*exporterConfig) error

ExporterOption is an optional change to the configuration used by the NewExporter function.

func CallingOnError added in v0.2.3

func CallingOnError(f func(error)) ExporterOption

CallingOnError specifies a hook function to be called when an error occurs sending events to Honeycomb.

If not specified, the default hook logs the errors. Specifying a nil value suppresses this default logging behavior.

func TargetingDataset added in v0.2.3

func TargetingDataset(name string) ExporterOption

TargetingDataset specifies the name of the Honeycomb dataset to which the exporter will send events.

If not specified, the default dataset name is "opentelemetry."

func WithAPIURL added in v0.2.3

func WithAPIURL(url string) ExporterOption

WithAPIURL specifies the URL for the Honeycomb API server to which to send events.

If not specified, the default URL is https://api.honeycomb.io/.

func WithDebug added in v0.4.3

func WithDebug(d bool) ExporterOption

WithDebug causes the exporter to emit verbose logging to STDOUT if provided with a true argument, otherwise it has no effect.

If you're having trouble getting the exporter to work, try enabling this logging in a development environment to help diagnose the problem.

func WithDebugEnabled added in v0.2.3

func WithDebugEnabled() ExporterOption

WithDebugEnabled causes the exporter to emit verbose logging to STDOUT.

If you're having trouble getting the exporter to work, try enabling this logging in a development environment to help diagnose the problem.

func WithDynamicField added in v0.2.3

func WithDynamicField(name string, f func() interface{}) ExporterOption

WithDynamicField adds a dynamic field with the given name to the exporter. Any events published by this exporter will include a field with the given name and a value supplied by invoking the corresponding function.

This function replaces any field registered previously with the same name.

func WithDynamicFields added in v0.2.3

func WithDynamicFields(m map[string]func() interface{}) ExporterOption

WithDynamicFields adds a set of dynamic fields to the exporter. Any events published by this exporter will include fields pairing each name in the given map with a value supplied by invoking the corresponding function.

This function replaces any field registered previously with the same name.

func WithField added in v0.2.3

func WithField(name string, value interface{}) ExporterOption

WithField adds a field with the given name and value to the exporter. Any events published by this exporter will include this field.

This function replaces any field registered previously with the same name.

func WithFields added in v0.2.3

func WithFields(m map[string]interface{}) ExporterOption

WithFields adds a set of fields to the exporter. Any events published by this exporter will include fields pairing each name in the given map with its corresponding value.

This function replaces any field registered previously with the same name.

func WithServiceName added in v0.2.3

func WithServiceName(name string) ExporterOption

WithServiceName specifies an identifier for your application for use in events sent by the exporter. While optional, specifying this name is extremely valuable when you instrument multiple services.

If set it will be added to all events as the field "service_name."

func WithUserAgentAddendum added in v0.2.3

func WithUserAgentAddendum(a string) ExporterOption

WithUserAgentAddendum specifies additional HTTP user agent-related detail to include in HTTP requests issued to send events to the Honeycomb API server. This value is appended to the user agent value from the libhoney library.

If not specified, the default value is "Honeycomb-OpenTelemetry-exporter."

Jump to

Keyboard shortcuts

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