mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-16 21:59:56 +00:00
Implements a comprehensive client metrics system to track peer connection stages and performance. The system supports multiple backend implementations (OpenTelemetry, VictoriaMetrics, and no-op) and tracks detailed connection stage durations from creation through WireGuard handshake. Key changes: - Add metrics package with pluggable backend implementations - Implement OpenTelemetry metrics backend - Implement VictoriaMetrics metrics backend - Add no-op metrics implementation for disabled state - Track connection stages: creation, semaphore, signaling, connection ready, and WireGuard handshake - Move WireGuard watcher functionality to conn.go - Refactor engine to integrate metrics tracking - Add metrics export endpoint in debug server
23 lines
344 B
Go
23 lines
344 B
Go
package metrics
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
)
|
|
|
|
// noopMetrics is a no-op implementation of metricsImplementation
|
|
type noopMetrics struct{}
|
|
|
|
func (s *noopMetrics) RecordConnectionStages(
|
|
_ context.Context,
|
|
_ ConnectionType,
|
|
_ bool,
|
|
_ ConnectionStageTimestamps,
|
|
) {
|
|
// No-op
|
|
}
|
|
|
|
func (s *noopMetrics) Export(_ io.Writer) error {
|
|
return nil
|
|
}
|