diff --git a/cmd/observability-proxy/main.go b/cmd/observability-proxy/main.go index c527f5061..e6652ad5f 100644 --- a/cmd/observability-proxy/main.go +++ b/cmd/observability-proxy/main.go @@ -113,8 +113,8 @@ func parseFlags(args []string) (options, error) { return o, fmt.Errorf("invalid metrics store name %q", store) } } - // Anything but namespace name characters would make the prefix match - // differently from the namespaces it is meant to name. + // The prefix is matched literally, so one no namespace name can start + // with would turn the exporter branch off without a word. if p := o.metrics.PlatformNamespacePrefix; p != "" && len(validation.IsDNS1123Label(p+"x")) > 0 { return o, fmt.Errorf("invalid metrics platform namespace prefix %q", p) } diff --git a/cmd/observability-proxy/main_test.go b/cmd/observability-proxy/main_test.go index 13e137dd2..a08f15d9e 100644 --- a/cmd/observability-proxy/main_test.go +++ b/cmd/observability-proxy/main_test.go @@ -112,8 +112,7 @@ func TestParseFlagsInvalid(t *testing.T) { {"--metrics-max-range=0s"}, {"--metrics-max-points=1"}, {"--metrics-max-timeout=0s"}, - // Only namespace name characters: a regex metacharacter or an upper - // case letter would widen or empty the scope. + // No namespace name starts with these, so they would match nothing. {"--metrics-platform-namespace-prefix=Cozy-"}, {"--metrics-platform-namespace-prefix=cozy.*"}, {"--metrics-platform-namespace-prefix=-"},