mirror of https://github.com/knative/pkg.git
Add default metrics backend to observability config (#994)
This commit is contained in:
parent
387a161d37
commit
bb0f16f214
|
@ -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 {
|
||||
|
|
|
@ -64,7 +64,7 @@ func TestObservabilityConfiguration(t *testing.T) {
|
|||
EnableVarLogCollection: false,
|
||||
LoggingURLTemplate: DefaultLogURLTemplate,
|
||||
RequestLogTemplate: "",
|
||||
RequestMetricsBackend: "",
|
||||
RequestMetricsBackend: DefaultRequestMetricsBackend,
|
||||
},
|
||||
config: &corev1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
|
Loading…
Reference in New Issue