monitoring

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveServiceName added in v1.11.5

func ResolveServiceName(tracingServiceName string, instanceName string, fallbackName string) string

ResolveServiceName determines the OpenTelemetry service name.

Priority:

  1. explicit tracing service name (if set and not an IP)
  2. configured instance name (if set and not an IP)
  3. hostname (if available and not an IP)
  4. fallbackName

Types

type ConnMonitor added in v1.2.0

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

ConnMonitor is a struct that implements monitoring of backend server connections by checking their availability.

func (*ConnMonitor) CheckBackendConnection added in v1.2.0

func (cm *ConnMonitor) CheckBackendConnection(server *config.BackendServer) error

CheckBackendConnection attempts to establish a connection to a backend server to verify its availability. It returns an error if the connection cannot be established, using the specified configuration parameters.

type Monitor added in v1.2.0

type Monitor interface {
	// CheckBackendConnection checks the backend connection of a server based on the provided Host address, port number, whether the server runs with HAProxy V2 protocol, and whether TLS should be used. It returns an error if the connection fails.
	CheckBackendConnection(server *config.BackendServer) error
}

Monitor defines an interface for monitoring and checking backend server connections. It provides a method to verify connectivity using specified configurations.

func NewMonitor added in v1.2.0

func NewMonitor(cfg config.File, logger *slog.Logger) Monitor

NewMonitor returns a new instance of the Monitor interface. The returned Monitor is implemented by the ConnMonitor struct.

type Telemetry added in v1.11.5

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

Telemetry provides lifecycle management for OpenTelemetry tracing.

func GetTelemetry added in v1.11.5

func GetTelemetry() *Telemetry

GetTelemetry returns the Telemetry singleton.

func (*Telemetry) SetProvider added in v1.11.5

func (t *Telemetry) SetProvider(p TelemetryConfigProvider)

SetProvider allows injecting a custom configuration provider (primarily for tests). In production the default provider is used, which reads from the global config.

func (*Telemetry) Shutdown added in v1.11.5

func (t *Telemetry) Shutdown(ctx context.Context)

Shutdown flushes and closes the Telemetry provider.

func (*Telemetry) Start added in v1.11.5

func (t *Telemetry) Start(ctx context.Context, appVersion string)

Start initializes OpenTelemetry according to configuration. Safe to call multiple times.

type TelemetryConfigProvider added in v1.11.5

type TelemetryConfigProvider interface {
	GetTracing() *config.Tracing
	GetInstanceName() string
}

TelemetryConfigProvider abstracts access to configuration used by telemetry. This allows unit tests to inject a lightweight mock without depending on the full global config.File implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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