Commit ca23d42c by Guangbo Chen Committed by Alena Prokharchyk

Add istio scrapes to rancher-monitoring

parent 2f5a830e
...@@ -10,3 +10,8 @@ ...@@ -10,3 +10,8 @@
{{- $name := include "app.name" . -}} {{- $name := include "app.name" . -}}
{{- printf "%s-%s-provisionings" $name .Release.Name -}} {{- printf "%s-%s-provisionings" $name .Release.Name -}}
{{- end -}} {{- 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: ...@@ -67,6 +67,8 @@ spec:
subPath: grafana/plugin.json subPath: grafana/plugin.json
- name: grafana-dashboards - name: grafana-dashboards
mountPath: /var/lib/grafana/rancher-dashboards mountPath: /var/lib/grafana/rancher-dashboards
- name: grafana-istio-dashboards
mountPath: /var/lib/grafana/rancher-istio-dashboards
- name: grafana-provisionings - name: grafana-provisionings
mountPath: /etc/grafana/provisioning/dashboards/all.yaml mountPath: /etc/grafana/provisioning/dashboards/all.yaml
subPath: dashboards.yaml subPath: dashboards.yaml
...@@ -153,6 +155,9 @@ spec: ...@@ -153,6 +155,9 @@ spec:
- name: grafana-dashboards - name: grafana-dashboards
configMap: configMap:
name: {{ template "app.dashboards.fullname" . }} name: {{ template "app.dashboards.fullname" . }}
- name: grafana-istio-dashboards
configMap:
name: {{ template "app.dashboards.istio-fullname" . }}
- name: grafana-provisionings - name: grafana-provisionings
configMap: configMap:
name: {{ template "app.provisionings.fullname" . }} name: {{ template "app.provisionings.fullname" . }}
...@@ -17,6 +17,14 @@ data: ...@@ -17,6 +17,14 @@ data:
updateIntervalSeconds: 0 #never updateIntervalSeconds: 0 #never
options: options:
path: /var/lib/grafana/rancher-dashboards 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: |+ datasources.yaml: |+
......
...@@ -17,5 +17,5 @@ spec: ...@@ -17,5 +17,5 @@ spec:
release: {{ .Release.Name }} release: {{ .Release.Name }}
ports: ports:
- name: metrics - name: metrics
port: 8080 port: 47323
targetPort: http 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: [] ...@@ -40,7 +40,7 @@ remoteWrite: []
retention: 24h retention: 24h
logLevel: "info" logLevel: "info"
logFormat: "" logFormat: "logfmt"
scrapeInterval: "60s" scrapeInterval: "60s"
evaluationInterval: "60s" evaluationInterval: "60s"
...@@ -71,3 +71,7 @@ additionalAlertManagerConfigs: [] ...@@ -71,3 +71,7 @@ additionalAlertManagerConfigs: []
# - static_configs: # - static_configs:
# - targets: # - targets:
# - "localhost:9093" # - "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