sdk

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sdk provides an auto-instrumentable OpenTelemetry SDK.

An go.opentelemetry.io/auto.Instrumentation can be configured to target the process running this SDK. In that case, all telemetry the SDK produces will be processed and handled by that go.opentelemetry.io/auto.Instrumentation.

By default, if there is no go.opentelemetry.io/auto.Instrumentation set to auto-instrument the SDK, the SDK will not generate any telemetry.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func TracerProvider

func TracerProvider() trace.TracerProvider

TracerProvider returns an auto-instrumentable trace.TracerProvider.

If an go.opentelemetry.io/auto.Instrumentation is configured to instrument the process using the returned TracerProvider, all of the telemetry it produces will be processed and handled by that Instrumentation. By default, if no Instrumentation instruments the TracerProvider it will not generate any trace telemetry.

Example
// Get a Tracer from an auto-instrumented TracerProvider so all spans
// created will be passed to the auto-instrumentation telemetry pipeline.
tracer := TracerProvider().Tracer("my.pkg/name")

// The tracer is used normally to create spans to encapsulate work.
_, span := tracer.Start(context.Background(), "do.work")
defer span.End()

// Do work ...
Output:

Types

This section is empty.

Directories

Path Synopsis
internal
telemetry
Package telemetry provides a lightweight representations of OpenTelemetry telemetry that is compatible with the OTLP JSON protobuf encoding.
Package telemetry provides a lightweight representations of OpenTelemetry telemetry that is compatible with the OTLP JSON protobuf encoding.
telemetry
test Module

Jump to

Keyboard shortcuts

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