mirror of https://github.com/knative/docs.git
				
				
				
			
		
			
				
	
	
	
		
			1.8 KiB
		
	
	
	
	
	
			
		
		
	
	
			1.8 KiB
		
	
	
	
	
	
| audience | components | function | |
|---|---|---|---|
| administrator | 
 | how-to | 
--8<-- "collecting-metrics.md"
Enabling Metric Collection
- To enable prometheus metrics collection you will want to update config-observabilityConfigMap and set themetrics-protocoltoprometheus. For request-metrics we recommend setting up pushing metrics to prometheus. This requires enabling the Prometheus OLTP receiver. This is already configured in our monitoring example.
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-observability
  namespace: knative-serving
data:
    # metrics-protocol field specifies the protocol used when exporting metrics
    # It supports either 'none' (the default), 'prometheus', 'http/protobuf' (OTLP HTTP), 'grpc' (OTLP gRPC)
    metrics-protocol: prometheus
    # request-metrics-protocol
    request-metrics-protocol: http/protobuf
    request-metrics-endpoint: http://knative-kube-prometheus-st-prometheus.observability.svc:9090/api/v1/otlp/v1/metrics
    tracing-protocol:      http/protobuf
    tracing-endpoint:      http://jaeger-collector.observability.svc:4318/v1/traces
    tracing-sampling-rate: "1"
- 
Apply the ServiceMonitors/PodMonitors to collect metrics from Knative Serving Control Plane. kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/serving-monitors.yaml
Import Grafana dashboards
- 
Grafana dashboards can be imported from the monitoringrepository.
- 
If you are using the Grafana Helm Chart with the dashboard sidecar enabled (the default), you can load the dashboards by applying the following configmaps. kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-serving-dashboard.yaml