From 99bda973fac42894a32c98d1d9dbf21552ae4206 Mon Sep 17 00:00:00 2001 From: Brian Ginsburg Date: Mon, 18 Nov 2024 14:02:19 -0800 Subject: [PATCH] refactor: Simplify metrics options check --- pkg/options/otel.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/options/otel.go b/pkg/options/otel.go index b9b75cc9..38f835c2 100644 --- a/pkg/options/otel.go +++ b/pkg/options/otel.go @@ -83,10 +83,8 @@ func CheckTelemetryOptions(options system.TelemetryOptions) error { } func CheckMetricsOptions(options system.MetricsOptions) error { - if options.Enable { - if len(options.URL) == 0 { - return fmt.Errorf("No metrics endpoint specified - please use METRICS_URL or --metrics-url") - } + if options.Enable && len(options.URL) == 0 { + return fmt.Errorf("No metrics endpoint specified - please use METRICS_URL or --metrics-url") } return nil