diff --git a/config/config-observability.yaml b/config/config-observability.yaml index 6b002ab0d727..4d736ed12376 100644 --- a/config/config-observability.yaml +++ b/config/config-observability.yaml @@ -89,8 +89,8 @@ data: metrics.backend-destination: prometheus # metrics.request-metrics-backend-destination specifies the request metrics - # destination. If non-empty, it enables queue proxy to send request metrics. - # Currently supported values: prometheus, stackdriver. + # destination. It enables queue proxy to send request metrics. + # Currently supported values: prometheus (the default), stackdriver. metrics.request-metrics-backend-destination: prometheus # metrics.stackdriver-project-id field specifies the stackdriver project ID. This diff --git a/pkg/metrics/config.go b/pkg/metrics/config.go index 110240717ee7..8c847060aa9c 100644 --- a/pkg/metrics/config.go +++ b/pkg/metrics/config.go @@ -24,7 +24,8 @@ import ( ) const ( - defaultLogURLTemplate = "http://localhost:8001/api/v1/namespaces/knative-monitoring/services/kibana-logging/proxy/app/kibana#/discover?_a=(query:(match:(kubernetes.labels.knative-dev%2FrevisionUID:(query:'${REVISION_UID}',type:phrase))))" + defaultLogURLTemplate = "http://localhost:8001/api/v1/namespaces/knative-monitoring/services/kibana-logging/proxy/app/kibana#/discover?_a=(query:(match:(kubernetes.labels.knative-dev%2FrevisionUID:(query:'${REVISION_UID}',type:phrase))))" + defaultRequestMetricsBackend = "prometheus" ) // ObservabilityConfig contains the configuration defined in the observability ConfigMap. @@ -79,6 +80,8 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab if mb, ok := configMap.Data["metrics.request-metrics-backend-destination"]; ok { oc.RequestMetricsBackend = mb + } else { + oc.RequestMetricsBackend = defaultRequestMetricsBackend } if prof, ok := configMap.Data["profiling.enable"]; ok { diff --git a/pkg/metrics/config_test.go b/pkg/metrics/config_test.go index 7de4469e2f3f..b5318b40bc00 100644 --- a/pkg/metrics/config_test.go +++ b/pkg/metrics/config_test.go @@ -78,7 +78,7 @@ func TestObservabilityConfiguration(t *testing.T) { EnableVarLogCollection: false, LoggingURLTemplate: defaultLogURLTemplate, RequestLogTemplate: "", - RequestMetricsBackend: "", + RequestMetricsBackend: "prometheus", }, config: &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{