telemetry

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SlogJSON = log.SlogJSON

SlogJSON JSON marshals any value into a slog.Attr.

Functions

func ContextWithLogger added in v0.0.7

func ContextWithLogger(ctx context.Context, logger *slog.Logger) context.Context

ContextWithLogger is very similar to `log.ContextWithLogger` except that it uses an otelslog log handler by default.

func LoggerFromContext added in v0.0.7

func LoggerFromContext(ctx context.Context) *slog.Logger

LoggerFromContext is very similar to `log.LoggerFromContext` except that it uses an otelslog log handler by default.

func NewLogger added in v0.0.7

func NewLogger() *slog.Logger

NewLogger is very similar to `log.NewLogger` except that it includes an otelslog handler.

func OtelJSON

func OtelJSON(key string, value any) attribute.KeyValue

OtelJSON JSON marshals any value into an otel attribute.KeyValue

Types

type TelemetryStuff added in v0.0.8

type TelemetryStuff struct {
	Context        context.Context
	Logger         *slog.Logger
	CpuprofileFile *os.File
	MemprofileFile *os.File
	OtlpExporter   *otlptrace.Exporter
}

func StartTelemetry

func StartTelemetry(ctx context.Context) *TelemetryStuff

StartTelemetry starts OpenTelemetry if PULUMI_MID_OTLP_ENDPOINT is set and returns a shutdown function. If PULUMI_MID_OTLP_ENDPOINT is not set it will do nothing and return an no-op function.

func (*TelemetryStuff) Shutdown added in v0.0.8

func (ts *TelemetryStuff) Shutdown()

Jump to

Keyboard shortcuts

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