Version: v0.6.0 Latest Latest

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0



Package distro provides functionality to quickly setup the OpenTelemetry Go implementation with useful Splunk defaults.

The default configuration sets the default OpenTelemetry SDK to propagate traces using B3 propagator and export all spans to a locally running Splunk OpenTelemetry Connector (http://localhost:14268/api/traces).

package main

import (


func main() {
	// By default, the Run function creates a Jaeger Thrift over HTTP exporter
	// to http://localhost:14268/api/traces and configures the B3 context
	// propagation format to be used in extracting and injecting trace context.
	sdk, err := distro.Run()
	if err != nil {
	// To ensure all spans are flushed before the application exits, make sure
	// to shutdown.
	defer func() {
		if err := sdk.Shutdown(context.Background()); err != nil {




This section is empty.


This section is empty.


This section is empty.


type Option

type Option interface {
	// contains filtered or unexported methods

Option sets a config setting value.

func WithAccessToken added in v0.3.0

func WithAccessToken(accessToken string) Option

WithAccessToken configures the authentication token allowing exporters to send data directly to a Splunk back-end. Setting empty string results in no operation.

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint configures the endpoint telemetry is sent to. Setting empty string results in no operation.

type SDK

type SDK struct {
	// contains filtered or unexported fields

SDK contains all OpenTelemetry SDK state and provides access to this state.

func Run

func Run(opts ...Option) (SDK, error)

Run configures the default OpenTelemetry SDK and installs it globally.

func (SDK) Shutdown

func (s SDK) Shutdown(ctx context.Context) error

Shutdown stops the SDK and releases any used resources.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL