telemetry

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndWithStatus

func EndWithStatus(span trace.Span, err error)

EndWithStatus ends the span with the status of the error if not nil otherwise it will set the status to OK.

This function should be used for ending spans, not for starting spans or spans that will have children, to avoid duplicate error recordings.

Do not defer this function directly since err might be nil at the start of defer call. Instead it should be wrapped in a function to capture the error correctly.

Example:

var err error
ctx, span := tracer.Start(ctx, "my-operation")
defer func() { telemetry.EndWithStatus(span, err) }()

Types

type Telemetry

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

func New

func New(ctx context.Context, cfg *config.Config) (tele Telemetry, err error)

func (*Telemetry) Close

func (te *Telemetry) Close() error

Jump to

Keyboard shortcuts

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