mirror of
				https://github.com/prometheus-operator/kube-prometheus.git
				synced 2025-10-30 23:51:01 +01:00 
			
		
		
		
	Docs for rawGrafanaDashboards filed
Propose in this https://github.com/brancz/kubernetes-grafana/pull/78
This commit is contained in:
		
							parent
							
								
									03b36af546
								
							
						
					
					
						commit
						059e74d156
					
				| @ -310,3 +310,23 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { | ||||
| { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + | ||||
| { ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } | ||||
| ``` | ||||
| 
 | ||||
| Incase you have lots of json dashboard exported out from grafan UI the above approch is going to take lots of time. to improve performance we can use `rawGrafanaDashboards` field and provide it's value as json string by using importstr | ||||
| ```jsonnet | ||||
| local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { | ||||
|   _config+:: { | ||||
|     namespace: 'monitoring', | ||||
|   }, | ||||
|   rawGrafanaDashboards+:: { | ||||
|     'my-dashboard.json': (importstr 'example-grafana-dashboard.json'), | ||||
|   }, | ||||
| }; | ||||
| 
 | ||||
| { ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } + | ||||
| { ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } + | ||||
| { ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } + | ||||
| { ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } + | ||||
| { ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } + | ||||
| { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + | ||||
| { ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } | ||||
| ``` | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user