Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional prometheus pod monitor #135

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified charts/trino/README.md
Binary file not shown.
26 changes: 26 additions & 0 deletions charts/trino/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.monitoring.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "trino.fullname" . }}
labels:
{{- include "trino.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "trino.selectorLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
podMetricsEndpoints:
- interval: {{ .Values.monitoring.interval}}
scrapeTimeout: {{ .Values.monitoring.scrapeTimeout }}
path: {{ .Values.monitoring.path }}
port: {{ .Values.monitoring.port }}
honorLabels: {{ .Values.monitoring.honorLabels }}
honorTimestamps: {{ .Values.monitoring.honorTimestamps }}
podTargetLabels:
{{- range .Values.monitoring.additionalPodTargetLabels }}
- {{ . }}
{{- end }}
{{- end }}
26 changes: 26 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,29 @@
# - secretName: chart-example-tls
# hosts:
# - chart-example.local


# Requires the prometheus-operator to be installed in the cluster
# Requires jmx_exporter to be installed in the cluster
Comment on lines +444 to +445
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how we should test this. Should there be a separate job in https://github.com/trinodb/charts/blob/main/.github/workflows/ci-cd.yaml, that would install these requirements? If we won't be testing this, I don't think it should be included in the chart.

monitoring:
# monitoring.enabled -- Enable or disable monitoring on your pod.
enabled: false
# monitoring.path -- define the path of the Prometheus endpoint
path: /metrics
# monitoring.port -- define the port of the Prometheus endpoint
port: 9483
# monitoring.interval -- interval for scraping metrics
interval: 15s
# monitoring.scrapeTimeout -- timeout for scraping metrics
scrapeTimeout: 15s
# monitoring.honorLabels -- honor labels in the scrape
honorLabels: true
# monitoring.honorTimestamps -- honor timestamps in the scrape
honorTimestamps: true
# monitoring.additionalPodTargetLabels -- extra labels from your pods that you want to appear in your metrics
additionalPodTargetLabels: []
# - label: "app"
# path: "metadata.labels.app"
# - label: "release"
# path: "metadata.labels.release"

Check failure on line 467 in charts/trino/values.yaml

View workflow job for this annotation

GitHub Actions / lint

[empty-lines] too many blank lines (1 > 0)
Loading