diff --git a/api/v1alpha1/envoygateway_helpers.go b/api/v1alpha1/envoygateway_helpers.go index 25866ed1203..09077991c87 100644 --- a/api/v1alpha1/envoygateway_helpers.go +++ b/api/v1alpha1/envoygateway_helpers.go @@ -104,12 +104,12 @@ func DefaultEnvoyGatewayLogging() *EnvoyGatewayLogging { // GetEnvoyGatewayTelemetry returns the EnvoyGatewayTelemetry of EnvoyGateway or a default EnvoyGatewayTelemetry if unspecified. func (e *EnvoyGateway) GetEnvoyGatewayTelemetry() *EnvoyGatewayTelemetry { if e.Telemetry != nil { - if e.Telemetry.Metrics.Prometheus == nil { - e.Telemetry.Metrics.Prometheus = DefaultEnvoyGatewayPrometheus() - } if e.Telemetry.Metrics == nil { e.Telemetry.Metrics = DefaultEnvoyGatewayMetrics() } + if e.Telemetry.Metrics.Prometheus == nil { + e.Telemetry.Metrics.Prometheus = DefaultEnvoyGatewayPrometheus() + } return e.Telemetry } e.Telemetry = DefaultEnvoyGatewayTelemetry()