Documentation ¶
Overview ¶
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).
Example ¶
package main import ( "context" "github.com/signalfx/splunk-otel-go/distro" ) 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 { panic(err) } // To ensure all spans are flushed before the application exits, make sure // to shutdown. defer func() { if err := sdk.Shutdown(context.Background()); err != nil { panic(err) } }() }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option sets a config setting value.
func WithAccessToken ¶ added in v0.3.0
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 ¶
WithEndpoint configures the endpoint telemetry is sent to. Setting empty string results in no operation.