Add default metrics backend to observability config (#994)

This commit is contained in:
Nima Kaviani 2020-01-14 23:08:06 -08:00 committed by Knative Prow Robot
parent 387a161d37
commit bb0f16f214
2 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,10 @@ import (
const (
// The following is used to set the default log url template
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))))"
// The following is used to set the default metrics backend
DefaultRequestMetricsBackend = "prometheus"
// The env var name for config-observability
ConfigMapNameEnv = "CONFIG_OBSERVABILITY_NAME"
)
@ -84,6 +88,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 {

View File

@ -64,7 +64,7 @@ func TestObservabilityConfiguration(t *testing.T) {
EnableVarLogCollection: false,
LoggingURLTemplate: DefaultLogURLTemplate,
RequestLogTemplate: "",
RequestMetricsBackend: "",
RequestMetricsBackend: DefaultRequestMetricsBackend,
},
config: &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{