telemetry

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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