honeycomb

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 11 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

This section is empty.

Types

type Config

type Config struct {
	// ApiKey is your Honeycomb authentication token, available from
	// https://ui.honeycomb.io/account. default: apikey-placeholder
	ApiKey string
	// Dataset is the name of the Honeycomb dataset to which events will be
	// sent. default: beeline-go
	Dataset string
	// Service Name identifies your application. While optional, setting this
	// field is extremely valuable when you instrument multiple services. If set
	// it will be added to all events as `service_name`
	ServiceName string
	// Debug will emit verbose logging to STDOUT when true. If you're having
	// trouble getting the beeline to work, set this to true in a dev
	// environment.
	Debug bool
	// APIHost is the hostname for the Honeycomb API server to which to send
	// these events. default: https://api.honeycomb.io/
	APIHost string
	// OnError is the hook to be called when there is
	// an error occurred when uploading the span data.
	// If no custom hook is set, errors are logged.
	OnError func(err error)
}

type Exporter

type Exporter struct {
	Builder        *libhoney.Builder
	SampleFraction float64
	// Service Name identifies your application. While optional, setting this
	// field is extremely valuable when you instrument multiple services. If set
	// it will be added to all events as `service_name`
	ServiceName string
	// Debug will emit verbose logging to STDOUT when true.
	// If you're having trouble getting the exporter to work, set this to true in a dev
	// environment
	Debug bool
	// OnError is the hook to be called when there is
	// an error occurred when uploading the span data.
	// If no custom hook is set, errors are logged.
	OnError func(err error)
	// contains filtered or unexported fields
}

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

func NewExporter

func NewExporter(config Config) (*Exporter, error)

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

apiKey is your Honeycomb apiKey (also known as your write key) dataset is the name of your Honeycomb dataset

Don't have a Honeycomb account? Sign up at https://ui.honeycomb.io/signup

func (*Exporter) Close

func (e *Exporter) Close()

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

func (*Exporter) ExportSpan

func (e *Exporter) ExportSpan(ctx context.Context, data *export.SpanData)

ExportSpan exports a SpanData to Honeycomb.

func (*Exporter) RegisterSimpleSpanProcessor added in v0.0.5

func (e *Exporter) RegisterSimpleSpanProcessor()

type Span

type Span struct {
	TraceID         string  `json:"trace.trace_id"`
	Name            string  `json:"name"`
	ID              string  `json:"trace.span_id"`
	ParentID        string  `json:"trace.parent_id,omitempty"`
	DurationMilli   float64 `json:"duration_ms"`
	Status          string  `json:"response.status_code,omitempty"`
	Error           bool    `json:"error,omitempty"`
	HasRemoteParent bool    `json:"has_remote_parent"`
}

Span is the format of trace events that Honeycomb accepts

type SpanEvent

type SpanEvent struct {
	Name          string  `json:"name"`
	TraceID       string  `json:"trace.trace_id"`
	ParentID      string  `json:"trace.parent_id,omitempty"`
	DurationMilli float64 `json:"duration_ms"`
	SpanEventType string  `json:"meta.span_type"`
}

SpanEvent represents an event attached to a specific span.

Jump to

Keyboard shortcuts

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