telemetry

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Truthy

func Truthy(value string) bool

func WithExporterForTest

func WithExporterForTest(ctx context.Context, exporter sdktrace.SpanExporter) context.Context

WithExporterForTest supplies an in-process exporter while preserving Start's normal ownership and enablement rules.

Types

type APIRequest

type APIRequest struct {
	Service         string
	API             string
	APIVersion      string
	Transport       string
	OperationID     string
	Attempt         int
	RetryObservable bool
}

type Identity

type Identity struct {
	Hash string
	Type string
}

type IdentityResolver

type IdentityResolver func(context.Context) (Identity, error)

type Options

type Options struct {
	Enabled    bool
	Surface    string
	Version    string
	ConfigPath string
}

type Session

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

Session owns a private provider and one command root span. It deliberately does not install a process-global TracerProvider.

func FromContext

func FromContext(ctx context.Context) *Session

func Start

func Start(ctx context.Context, options Options) (context.Context, *Session)

func (*Session) Finish

func (s *Session) Finish(command string, exitCode int)

func (*Session) NextOperationID

func (s *Session) NextOperationID() string

func (*Session) RecordCredentialOutcome added in v0.2.1

func (s *Session) RecordCredentialOutcome(outcome string)

RecordCredentialOutcome records a fixed, secret-free credential lifecycle outcome on the command span. Callers must pass only enumerated values.

func (*Session) RegisterIdentity

func (s *Session) RegisterIdentity(credentialKey string, resolver IdentityResolver)

func (*Session) StartAPI

func (s *Session) StartAPI(request APIRequest) func(error)

StartAPI starts a direct child of the command root span. The returned function records only a coarse outcome; it never records the error itself.

Jump to

Keyboard shortcuts

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