From e3c0aaa5ef4b2fa6ac4818fdebfb0fc2c257a519 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Thu, 26 Feb 2026 12:49:33 -0600 Subject: [PATCH] Remove Datadog metrics --- cmd/internal/config/config.go | 1 - cmd/kt-server/main.go | 2 +- cmd/kt-server/metrics.go | 12 +----------- go.mod | 2 -- go.sum | 4 ---- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/cmd/internal/config/config.go b/cmd/internal/config/config.go index db7bbb0..ef9466d 100644 --- a/cmd/internal/config/config.go +++ b/cmd/internal/config/config.go @@ -45,7 +45,6 @@ type Config struct { LogOutputFile string `yaml:"log-output"` MetricsAddr string `yaml:"metrics-addr"` - DatadogAddr string `yaml:"datadog-addr"` OtlpEnabled bool `yaml:"otlp-enabled"` // Whether to configure OpenTelemetry Metrics HealthAddr string `yaml:"health-addr"` diff --git a/cmd/kt-server/main.go b/cmd/kt-server/main.go index 4797bd7..243ae3d 100644 --- a/cmd/kt-server/main.go +++ b/cmd/kt-server/main.go @@ -97,7 +97,7 @@ func main() { go healthServer.Serve(lis) // Start the metrics server. - exportMetrics(ctx, config.DatadogAddr, config.OtlpEnabled) + exportMetrics(ctx, config.OtlpEnabled) go metricsServer(config.MetricsAddr) // Start the inserter thread. diff --git a/cmd/kt-server/metrics.go b/cmd/kt-server/metrics.go index 0241172..be61b47 100644 --- a/cmd/kt-server/metrics.go +++ b/cmd/kt-server/metrics.go @@ -12,7 +12,6 @@ import ( "net/http/pprof" metrics "github.com/hashicorp/go-metrics" - "github.com/hashicorp/go-metrics/datadog" "github.com/hashicorp/go-metrics/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ktmetrics "github.com/signalapp/keytransparency/cmd/kt-server/metrics" @@ -42,7 +41,7 @@ func endpointLabel(endpoint string) metrics.Label { return metrics.Label{Name: "endpoint", Value: endpoint} } -func exportMetrics(ctx context.Context, addr string, otlpEnabled bool) { +func exportMetrics(ctx context.Context, otlpEnabled bool) { prom, err := prometheus.NewPrometheusSink() if err != nil { util.Log().Fatalf("building prometheus sink: %v", err) @@ -50,15 +49,6 @@ func exportMetrics(ctx context.Context, addr string, otlpEnabled bool) { sink := metrics.FanoutSink{prom} defer sink.Shutdown() - if addr != "" { - util.Log().Infof("Initiating datadog metrics at %q", addr) - ddog, err := datadog.NewDogStatsdSink(addr, "") - if err != nil { - util.Log().Fatalf("error initializing statsd client: %v", err) - } - sink = append(sink, ddog) - } - if otlpEnabled { util.Log().Infof("Initiating otlp metrics") otlpSink, err := ktmetrics.NewOTLPSink(ctx) diff --git a/go.mod b/go.mod index decb6b0..1fcb576 100644 --- a/go.mod +++ b/go.mod @@ -32,8 +32,6 @@ require ( ) require ( - github.com/DataDog/datadog-go v4.8.3+incompatible // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.3 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.19.2 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.14 // indirect diff --git a/go.sum b/go.sum index 8298430..f48f8a5 100644 --- a/go.sum +++ b/go.sum @@ -3,10 +3,6 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= -github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= -github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=