telemetry

package
v1.6.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics() (err error)

func RecordPackageRevisionResourcesSize

func RecordPackageRevisionResourcesSize(ctx context.Context, prKey repository.PackageRevisionKey, resourcesSize int64)

Porch server and function runner metric recording functions

Types

type OTelResources

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

OTelResources holds all OpenTelemetry resources that need lifecycle management. Use Shutdown() to cleanly release all resources.

func SetupOpenTelemetry

func SetupOpenTelemetry(ctx context.Context) (*OTelResources, error)

SetupOpenTelemetry is the single entry point for all OpenTelemetry setup. It configures tracing, metrics (including the Prometheus HTTP server if OTEL_EXPORTER_PROMETHEUS_HOST and OTEL_EXPORTER_PROMETHEUS_PORT are set), and initializes all Porch metric instruments. Returns OTelResources for lifecycle management.

func (*OTelResources) Flush

func (r *OTelResources) Flush() error

Flush forces a flush of the meter provider, useful in tests.

func (*OTelResources) Shutdown

func (r *OTelResources) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down all OpenTelemetry resources.

func (*OTelResources) ShutdownWithTimeout

func (r *OTelResources) ShutdownWithTimeout(timeout time.Duration) error

ShutdownWithTimeout is a convenience wrapper around Shutdown with a timeout.

Jump to

Keyboard shortcuts

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