Skip to content

Commit e7af78d

Browse files
author
github-actions
committed
Update perfectscale-prom-exporter chart with new package version v0.1.0
1 parent ff136a3 commit e7af78d

File tree

8 files changed

+1123
-131
lines changed

8 files changed

+1123
-131
lines changed

charts/psc-prom-exporter/dashboards/grafana/workload-overview.json

Lines changed: 929 additions & 0 deletions
Large diffs are not rendered by default.

charts/psc-prom-exporter/templates/_helpers.tpl

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,33 @@ For testing purposes, in prod we want to get the actual cluster's UID
106106
107107
{{- define "datadogAD.v1annotations" -}}
108108
ad.datadoghq.com/{{ .containerName }}.check_names: '["openmetrics"]'
109-
ad.datadoghq.com/{{ .containerName }}.init_configs: '[{}]'
109+
ad.datadoghq.com/{{ .containerName }}.init_configs: "[{}]"
110+
{{- if .config.maxReturnedMetrics }}
111+
ad.datadoghq.com/{{ .containerName }}.max_returned_metrics: "{{ .config.maxReturnedMetrics }}"
112+
{{- end }}
110113
ad.datadoghq.com/{{ .containerName }}.instances: |
111114
[
112115
{
113116
"openmetrics_endpoint": "http://%%host%%:{{ .config.port }}{{ .config.endpoint }}",
114117
"namespace": "{{ .config.namespace }}",
118+
{{- if .config.options }}
119+
{{- range $key, $value := .config.options }}
120+
"{{ $key }}": {{ $value }},
121+
{{- end }}
115122
{{- if .config.metrics }}
116123
"metrics": [
117124
{{- range $index, $metric := .config.metrics }}
118125
{{- if $index }},{{ end }}
119126
{{- if .rename }}
120127
{
121-
"{{ .name }}": "{{ .rename }}"
128+
{"{{ .name }}": "{{ .rename }}"}
122129
}
123130
{{- else }}
124131
"{{ .name }}"
125132
{{- end }}
126133
{{- end }}
127134
]
128135
{{- end }}
129-
{{- if .config.options }}
130-
{{- range $key, $value := .config.options }}
131-
,"{{ $key }}": {{ $value }}
132-
{{- end }}
133136
{{- end }}
134137
}
135138
]
@@ -144,22 +147,25 @@ ad.datadoghq.com/{{ .containerName }}.checks: |
144147
{
145148
"openmetrics_endpoint": "http://%%host%%:{{ .config.port }}{{ .config.endpoint }}",
146149
"namespace": "{{ .config.namespace }}",
150+
{{- if .config.maxReturnedMetrics }}
151+
"max_returned_metrics": "{{ .config.maxReturnedMetrics }}",
152+
{{- end }}
153+
{{- if .config.options }}
154+
{{- range $key, $value := .config.options }}
155+
"{{ $key }}": {{ $value }},
156+
{{- end }}
157+
{{- end }}
147158
{{- if .config.metrics }}
148-
"metrics": {
159+
"metrics": [
149160
{{- range $index, $metric := .config.metrics }}
150161
{{- if $index }},{{ end }}
151162
{{- if .rename }}
152-
"{{ .name }}": "{{ .rename }}"
163+
{"{{ .name }}": "{{ .rename }}"}
153164
{{- else }}
154-
"{{ .name }}": "{{ .name }}"
165+
"{{ .name }}"
155166
{{- end }}
156167
{{- end }}
157-
}
158-
{{- end }}
159-
{{- if .config.options }}
160-
{{- range $key, $value := .config.options }}
161-
,"{{ $key }}": {{ $value }}
162-
{{- end }}
168+
]
163169
{{- end }}
164170
}
165171
]
Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
1-
{{- if and .Values.scrapers.datadogOperator.enabled }}
1+
{{- if .Values.alerts.datadogMonitor.enabled }}
2+
{{- range .Values.alerts.datadogMonitor.rules }}
3+
{{- if .enabled }}
4+
---
25
apiVersion: datadoghq.com/v1alpha1
36
kind: DatadogMonitor
47
metadata:
5-
name: {{ include "helm.fullname" . }}-openmetrics
8+
name: {{ include "helm.fullname" $ }}-{{ kebabcase .alert }}
9+
{{- if $.Values.alerts.datadogMonitor.namespace }}
10+
namespace: {{ $.Values.alerts.datadogMonitor.namespace }}
11+
{{- end }}
612
labels:
7-
{{- include "helm.labels" . | nindent 4 }}
13+
{{- include "helm.labels" $ | nindent 4 }}
14+
{{- with $.Values.alerts.datadogMonitor.labels }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
817
spec:
9-
{{- with .Values.scrapers.datadogOperator.customConfig }}
10-
name: {{ .configName | default "psc-prom-exporter" }}
11-
namespaceSelector:
12-
matchNames: {{ .namespaceSelector.matchNames | default list }}
13-
endpoints:
14-
{{- toYaml .endpoints | nindent 4 }}
15-
pattern: {{ .pattern | default "ps_.*" }}
18+
query: {{ .query | quote }}
19+
type: {{ .type | quote }}
20+
name: {{ .alert | quote }}
21+
message: {{ .message | quote }}
22+
{{- if .runbook }}
23+
options:
24+
escalation_message: {{ .runbook | quote }}
25+
{{- end }}
26+
{{- with .tags }}
27+
tags:
28+
{{- toYaml . | nindent 4 }}
29+
{{- end }}
30+
{{- with .labels }}
31+
labels:
32+
{{- toYaml . | nindent 4 }}
1633
{{- end }}
1734
{{- end }}
35+
{{- end }}
36+
{{- end }}

charts/psc-prom-exporter/templates/deployment.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ spec:
3333
{{- if and .Values.scrapers.datadog.enabled (eq .Values.scrapers.datadog.adVersion "v2") }}
3434
{{- include "datadogAD.v2annotations" .Values.scrapers.datadog | nindent 8 }}
3535
{{- end }}
36+
{{- with .Values.podAnnotations }}
37+
{{- toYaml . | nindent 8 }}
38+
{{- end }}
3639
spec:
3740
{{- if ne .Values.priorityClass.enabled false}}
3841
priorityClassName: {{ .Values.priorityClass.name | default "perfectscale-exporter" }}
@@ -87,16 +90,6 @@ spec:
8790
value: "{{ include "helm.exporter.clusterUID" . }}"
8891
- name: CLUSTER_RESILIENCE_LEVEL
8992
value: "{{ .Values.settings.clusterResilienceLevel }}"
90-
- name: DEMO_ENV_ADDRESS
91-
value: "{{ .Values.settings.demoEnvAddress }}"
92-
- name: ENABLE_PPROF
93-
value: "{{ .Values.settings.enablePProf | default "false" }}"
94-
- name: ENABLE_OOM_DEBUG
95-
value: "{{ .Values.settings.enableOomDebug | default "false" }}"
96-
- name: POD_REGEX
97-
value: "{{ .Values.settings.podRegex | default "" }}"
98-
- name: CONTAINER_REGEX
99-
value: "{{ .Values.settings.containerRegex | default "" }}"
10093
- name: "KUBERNETES_CLIENT_BURST"
10194
value: "{{ .Values.settings.k8sClientBurst }}"
10295
- name: "KUBERNETES_CLIENT_QPS"
@@ -113,8 +106,6 @@ spec:
113106
name: {{ .Values.secret.name | default $fullName }}
114107
key: "clientSecret"
115108
optional: false
116-
- name: "CLUSTER_NAME"
117-
value: "{{ .Values.settings.clusterName }}"
118109
- name: REMOTE_LOG_BATCH_SIZE
119110
value: "{{ include "helm.exporter.remoteLogBatchSize" . }}"
120111
- name: REMOTE_LOG_BATCH_INTERVAL
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if .Values.dashboards.grafana.enabled }}
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: {{ .Values.dashboards.grafana.name | default (printf "%s-dashboards" (include "helm.fullname" .)) }}
7+
namespace: {{ .Values.dashboards.grafana.namespace | default .Release.Namespace }}
8+
labels:
9+
{{- include "helm.labels" . | nindent 4 }}
10+
{{- with .Values.dashboards.grafana.labels }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- with .Values.dashboards.grafana.annotations }}
14+
annotations:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
data:
18+
"perfectscale-workload-overview.json": |
19+
{{ .Files.Get "dashboards/grafana/workload-overview.json" | fromJson | toJson }}
20+
{{- end }}

charts/psc-prom-exporter/templates/prometheus-rule.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
{{- if .Values.prometheusRule.enabled -}}
1+
{{- if .Values.alerts.prometheusRule.enabled -}}
22
{{- $fullName := include "helm.fullname" . -}}
33
apiVersion: monitoring.coreos.com/v1
44
kind: PrometheusRule
55
metadata:
66
name: {{ $fullName }}
7+
{{- if .Values.alerts.prometheusRule.labels }}
78
labels:
8-
{{ toYaml .Values.prometheusRule.labels | indent 4 }}
9+
{{ toYaml .Values.alerts.prometheusRule.labels | indent 4 }}
10+
{{- end }}
11+
{{- if .Values.alerts.prometheusRule.annotations }}
912
annotations:
10-
{{ toYaml .Values.prometheusRule.annotations | indent 4 }}
13+
{{ toYaml .Values.alerts.prometheusRule.annotations | indent 4 }}
14+
{{- end }}
1115
spec:
1216
groups:
1317
- name: {{ include "helm.fullname" . }}
1418
rules:
15-
{{- range .Values.prometheusRule.rules }}
19+
{{- range .Values.alerts.prometheusRule.rules }}
1620
{{- if .enabled }}
1721
- {{- toYaml (omit . "enabled") | nindent 10 }}
1822
{{- end }}

charts/psc-prom-exporter/templates/service-monitor.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
{{- if .Values.serviceMonitor -}}
2-
{{- if .Values.serviceMonitor.enable -}}
1+
{{- if .Values.scrapers.serviceMonitor -}}
2+
{{- if .Values.scrapers.serviceMonitor.enabled -}}
33
apiVersion: monitoring.coreos.com/v1
44
kind: ServiceMonitor
55
metadata:
66
name: {{ include "helm.fullname" . }}
77
labels:
88
{{- include "helm.labels" . | nindent 4 }}
9-
{{- range $key, $value := .Values.serviceMonitor.labels }}
9+
{{- range $key, $value := .Values.scrapers.serviceMonitor.labels }}
1010
{{ $key }}: {{ $value | quote }}
1111
{{- end }}
1212
spec:
1313
endpoints:
1414
- port: http
15-
{{- if .Values.serviceMonitor.interval }}
16-
interval: {{ .Values.serviceMonitor.interval }}
15+
{{- if .Values.scrapers.serviceMonitor.interval }}
16+
interval: {{ .Values.scrapers.serviceMonitor.interval }}
1717
{{- end }}
18-
{{- if .Values.serviceMonitor.path }}
19-
path: {{ .Values.serviceMonitor.path }}
18+
{{- if .Values.scrapers.serviceMonitor.path }}
19+
path: {{ .Values.scrapers.serviceMonitor.path }}
2020
{{- end }}
21-
{{- if .Values.serviceMonitor.timeout }}
22-
scrapeTimeout: {{ .Values.serviceMonitor.timeout }}
21+
{{- if .Values.scrapers.serviceMonitor.timeout }}
22+
scrapeTimeout: {{ .Values.scrapers.serviceMonitor.timeout }}
2323
{{- end }}
2424
namespaceSelector:
2525
matchNames:

0 commit comments

Comments
 (0)