Skip to content
Merged
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
34 changes: 34 additions & 0 deletions charts/posthog/templates/grafana-annotation-post.job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This job gets installed only if Grafana, Loki and Promtail are enabled.
#
# It's an ephemeral container running at the start and end of each Helm
# deploy and it's used to log at stdout the Helm revision we are
# installing / we finished installing.
#
# This datapoint is useful and can be very helpful as annotation
# in Grafana dashboard.
#
{{- if and .Values.grafana.enabled (and .Values.loki.enabled .Values.promtail.enabled) }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ printf "%s-grafana-annotation-job-post-%s" .Release.Name (now | date "2006-01-02-15-04-05") }}
labels: {{- include "_snippet-metadata-labels-common" . | nindent 4 }}
annotations: {{- include "_snippet-metadata-annotations-common" . | nindent 4 }}
"helm.sh/hook": "post-install,post-upgrade,post-rollback"
spec:
template:
metadata:
name: {{ printf "%s-grafana-annotation-job-post-%s" .Release.Name (now | date "2006-01-02-15-04-05") }}
spec:
restartPolicy: Never
containers:
- name: grafana-annotation-job-post
image: {{ .Values.busybox.image }}
imagePullPolicy: {{ .Values.busybox.pullPolicy }}
command:
- /bin/sh
- -c
- |
echo '{"operation": "helm_release", "operation_stage": "end", "helm_revision": "{{ .Release.Revision }}"}'
{{- end }}
34 changes: 34 additions & 0 deletions charts/posthog/templates/grafana-annotation-pre.job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This job gets installed only if Grafana, Loki and Promtail are enabled.
#
# It's an ephemeral container running at the start and end of each Helm
# deploy and it's used to log at stdout the Helm revision we are
# installing / we finished installing.
#
# This datapoint is useful and can be very helpful as annotation
# in Grafana dashboard.
#
{{- if and .Values.grafana.enabled (and .Values.loki.enabled .Values.promtail.enabled) }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ printf "%s-grafana-annotation-job-pre-%s" .Release.Name (now | date "2006-01-02-15-04-05") }}
labels: {{- include "_snippet-metadata-labels-common" . | nindent 4 }}
annotations: {{- include "_snippet-metadata-annotations-common" . | nindent 4 }}
"helm.sh/hook": "pre-install,pre-upgrade,pre-rollback"
spec:
template:
metadata:
name: {{ printf "%s-grafana-annotation-job-pre-%s" .Release.Name (now | date "2006-01-02-15-04-05") }}
spec:
restartPolicy: Never
containers:
- name: grafana-annotation-job-pre
image: {{ .Values.busybox.image }}
imagePullPolicy: {{ .Values.busybox.pullPolicy }}
command:
- /bin/sh
- -c
- |
echo '{"operation": "helm_release", "operation_stage": "start", "helm_revision": "{{ .Release.Revision }}"}'
{{- end }}
4 changes: 2 additions & 2 deletions charts/posthog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ promtail:
config:
lokiAddress: http://posthog-loki:3100/loki/api/v1/push
## -- Pod annotations.
podAnnotations:
podAnnotations: {}
# Uncomment those lines if you want Prometheus server to scrape metrics.
# prometheus.io/scrape: "true"
# prometheus.io/path: /metrics
Expand All @@ -1201,7 +1201,7 @@ prometheus:
alertmanager:
# -- Whether to install Prometheus AlertManager or not.
enabled: false
podAnnotations:
podAnnotations: {}
# Uncomment those lines if you want Prometheus server to scrape metrics.
# prometheus.io/scrape: "true"
# prometheus.io/path: /metrics
Expand Down