mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-05 16:46:39 +00:00
Compare commits
3 Commits
fix/debug-
...
fix/remove
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b5e39c574 | ||
|
|
fd28178cc6 | ||
|
|
7f98cf30cf |
2
go.mod
2
go.mod
@@ -86,6 +86,7 @@ require (
|
|||||||
github.com/pires/go-proxyproto v0.11.0
|
github.com/pires/go-proxyproto v0.11.0
|
||||||
github.com/pkg/sftp v1.13.9
|
github.com/pkg/sftp v1.13.9
|
||||||
github.com/prometheus/client_golang v1.23.2
|
github.com/prometheus/client_golang v1.23.2
|
||||||
|
github.com/prometheus/otlptranslator v1.0.0
|
||||||
github.com/quic-go/quic-go v0.55.0
|
github.com/quic-go/quic-go v0.55.0
|
||||||
github.com/redis/go-redis/v9 v9.7.3
|
github.com/redis/go-redis/v9 v9.7.3
|
||||||
github.com/rs/xid v1.3.0
|
github.com/rs/xid v1.3.0
|
||||||
@@ -254,7 +255,6 @@ require (
|
|||||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||||
github.com/prometheus/client_model v0.6.2 // indirect
|
github.com/prometheus/client_model v0.6.2 // indirect
|
||||||
github.com/prometheus/common v0.67.5 // indirect
|
github.com/prometheus/common v0.67.5 // indirect
|
||||||
github.com/prometheus/otlptranslator v1.0.0 // indirect
|
|
||||||
github.com/prometheus/procfs v0.19.2 // indirect
|
github.com/prometheus/procfs v0.19.2 // indirect
|
||||||
github.com/russellhaering/goxmldsig v1.5.0 // indirect
|
github.com/russellhaering/goxmldsig v1.5.0 // indirect
|
||||||
github.com/rymdport/portal v0.4.2 // indirect
|
github.com/rymdport/portal v0.4.2 // indirect
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
prometheus2 "github.com/prometheus/client_golang/prometheus"
|
prometheus2 "github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
"github.com/prometheus/otlptranslator"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"go.opentelemetry.io/otel/exporters/prometheus"
|
"go.opentelemetry.io/otel/exporters/prometheus"
|
||||||
metric2 "go.opentelemetry.io/otel/metric"
|
metric2 "go.opentelemetry.io/otel/metric"
|
||||||
@@ -206,7 +207,9 @@ func (appMetrics *defaultAppMetrics) GetMeter() metric2.Meter {
|
|||||||
|
|
||||||
// NewDefaultAppMetrics and expose them via defaultEndpoint on a given HTTP port
|
// NewDefaultAppMetrics and expose them via defaultEndpoint on a given HTTP port
|
||||||
func NewDefaultAppMetrics(ctx context.Context) (AppMetrics, error) {
|
func NewDefaultAppMetrics(ctx context.Context) (AppMetrics, error) {
|
||||||
exporter, err := prometheus.New()
|
exporter, err := prometheus.New(
|
||||||
|
prometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithoutSuffixes),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create prometheus exporter: %w", err)
|
return nil, fmt.Errorf("failed to create prometheus exporter: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
"github.com/prometheus/otlptranslator"
|
||||||
"go.opentelemetry.io/otel/exporters/prometheus"
|
"go.opentelemetry.io/otel/exporters/prometheus"
|
||||||
"go.opentelemetry.io/otel/sdk/metric"
|
"go.opentelemetry.io/otel/sdk/metric"
|
||||||
|
|
||||||
@@ -51,7 +52,9 @@ func TestMetrics_RoundTripper(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
exporter, err := prometheus.New()
|
exporter, err := prometheus.New(
|
||||||
|
prometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithoutSuffixes),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("create prometheus exporter: %v", err)
|
t.Fatalf("create prometheus exporter: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import (
|
|||||||
"github.com/pires/go-proxyproto"
|
"github.com/pires/go-proxyproto"
|
||||||
prometheus2 "github.com/prometheus/client_golang/prometheus"
|
prometheus2 "github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
"github.com/prometheus/otlptranslator"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"go.opentelemetry.io/otel/exporters/prometheus"
|
"go.opentelemetry.io/otel/exporters/prometheus"
|
||||||
"go.opentelemetry.io/otel/sdk/metric"
|
"go.opentelemetry.io/otel/sdk/metric"
|
||||||
@@ -236,7 +237,9 @@ func (s *Server) ListenAndServe(ctx context.Context, addr string) (err error) {
|
|||||||
s.svcPorts = make(map[types.ServiceID][]uint16)
|
s.svcPorts = make(map[types.ServiceID][]uint16)
|
||||||
s.lastMappings = make(map[types.ServiceID]*proto.ProxyMapping)
|
s.lastMappings = make(map[types.ServiceID]*proto.ProxyMapping)
|
||||||
|
|
||||||
exporter, err := prometheus.New()
|
exporter, err := prometheus.New(
|
||||||
|
prometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithoutSuffixes),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("create prometheus exporter: %w", err)
|
return fmt.Errorf("create prometheus exporter: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
prometheus2 "github.com/prometheus/client_golang/prometheus"
|
prometheus2 "github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
"github.com/prometheus/otlptranslator"
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/exporters/prometheus"
|
"go.opentelemetry.io/otel/exporters/prometheus"
|
||||||
api "go.opentelemetry.io/otel/metric"
|
api "go.opentelemetry.io/otel/metric"
|
||||||
@@ -27,7 +28,9 @@ type Metrics struct {
|
|||||||
|
|
||||||
// NewServer initializes and returns a new Metrics instance
|
// NewServer initializes and returns a new Metrics instance
|
||||||
func NewServer(port int, endpoint string) (*Metrics, error) {
|
func NewServer(port int, endpoint string) (*Metrics, error) {
|
||||||
exporter, err := prometheus.New()
|
exporter, err := prometheus.New(
|
||||||
|
prometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithoutSuffixes),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user