otel

package
v1.12.29 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// NilShutdown is a no-op shutdown function that does nothing.
	NilShutdown = func(ctx context.Context) error { return nil }
)

Functions

func ExportRoleCertMetric

func ExportRoleCertMetric(cert *x509.Certificate)

ExportRoleCertMetric exports the role certificate expiry metric.

func ExportServiceCertMetric

func ExportServiceCertMetric(cert *x509.Certificate)

ExportServiceCertMetric exports the service certificate expiry metric.

func HttpTransport

func HttpTransport(base http.RoundTripper, opts ...otelhttp.Option) http.RoundTripper

HttpTransport returns a http.RoundTripper that is instrumented with OpenTelemetry if oTelEnabled is true.

func RecordAgentCommandResult

func RecordAgentCommandResult(function string, success bool)

RecordAgentCommandResult records the result of an agent command execution.

Types

type ShutdownFn

type ShutdownFn func(context.Context) error

ShutdownFn is a function type that defines oTel provider shutting down.

func StartOTelProvider

func StartOTelProvider(oTelCfg config.OTel) ShutdownFn

StartOTelProvider starts the OpenTelemetry provider, and returns a shutdown function. It first checks if the collector endpoint is configured and if the TLS file is ready. If not ready, it will start a goroutine waiting for the TLS files to be ready before initializing the OTel SDK.

Jump to

Keyboard shortcuts

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