Commit ca23d42c by Guangbo Chen Committed by Alena Prokharchyk

Add istio scrapes to rancher-monitoring

parent 2f5a830e
......@@ -9,4 +9,9 @@
{{- define "app.provisionings.fullname" -}}
{{- $name := include "app.name" . -}}
{{- printf "%s-%s-provisionings" $name .Release.Name -}}
{{- end -}}
\ No newline at end of file
{{- end -}}
{{- define "app.dashboards.istio-fullname" -}}
{{- $name := include "app.name" . -}}
{{- printf "%s-%s-%s-dashboards" $name "istio" .Release.Name -}}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.dashboards.istio-fullname" . }}
data:
{{- if eq .Values.level "cluster" }}
{{ (.Files.Glob "dashboards/istio/c_istio_*.json").AsConfig | indent 2 }}
{{- end }}
{{ (.Files.Glob "dashboards/istio/w_istio_*.json").AsConfig | indent 2 }}
......@@ -67,6 +67,8 @@ spec:
subPath: grafana/plugin.json
- name: grafana-dashboards
mountPath: /var/lib/grafana/rancher-dashboards
- name: grafana-istio-dashboards
mountPath: /var/lib/grafana/rancher-istio-dashboards
- name: grafana-provisionings
mountPath: /etc/grafana/provisioning/dashboards/all.yaml
subPath: dashboards.yaml
......@@ -153,6 +155,9 @@ spec:
- name: grafana-dashboards
configMap:
name: {{ template "app.dashboards.fullname" . }}
- name: grafana-istio-dashboards
configMap:
name: {{ template "app.dashboards.istio-fullname" . }}
- name: grafana-provisionings
configMap:
name: {{ template "app.provisionings.fullname" . }}
......@@ -17,6 +17,14 @@ data:
updateIntervalSeconds: 0 #never
options:
path: /var/lib/grafana/rancher-dashboards
- name: RANCHER_ISTIO_MONITORING
orgId: 2
folder: 'istio'
type: file
disableDeletion: false
updateIntervalSeconds: 0 #never
options:
path: /var/lib/grafana/rancher-istio-dashboards
datasources.yaml: |+
......
......@@ -17,5 +17,5 @@ spec:
release: {{ .Release.Name }}
ports:
- name: metrics
port: 8080
port: 47323
targetPort: http
{{- if .Values.istioMonitoring.enabled -}}
- job_name: 'istio/envoy-stats'
scrape_interval: 15s
metrics_path: /stats/prometheus
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_port_name]
action: keep
regex: '.*-envoy-prom'
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:15090
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: pod_name
- job_name: 'istio/istio-mesh'
scrape_interval: 15s
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- {{ .Values.istioMonitoring.namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: istio-telemetry;prometheus
metric_relabel_configs:
- source_labels: [source_workload_namespace]
action: replace
target_label: namespace
- job_name: 'istio/istio-policy'
scrape_interval: 15s
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- {{ .Values.istioMonitoring.namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: istio-policy;http-monitoring
- job_name: 'istio/istio-telemetry'
scrape_interval: 15s
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- {{ .Values.istioMonitoring.namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: istio-telemetry;http-monitoring
- job_name: 'istio/pilot'
scrape_interval: 15s
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- {{ .Values.istioMonitoring.namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: istio-pilot;http-monitoring
- job_name: 'istio/galley'
scrape_interval: 15s
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- {{ .Values.istioMonitoring.namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: istio-galley;http-monitoring
- job_name: 'istio/citadel'
scrape_interval: 15s
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- {{ .Values.istioMonitoring.namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: istio-citadel;http-monitoring
{{- end -}}
......@@ -40,7 +40,7 @@ remoteWrite: []
retention: 24h
logLevel: "info"
logFormat: ""
logFormat: "logfmt"
scrapeInterval: "60s"
evaluationInterval: "60s"
......@@ -71,3 +71,7 @@ additionalAlertManagerConfigs: []
# - static_configs:
# - targets:
# - "localhost:9093"
istioMonitoring:
enabled: true
namespace: istio-system
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment