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

feat(prometheus): Switch to upstream prometheus as the default Prometheus image #166

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
2 changes: 1 addition & 1 deletion charts/bindplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: bindplane
description: BindPlane OP is an observability pipeline.
type: application
# The chart's version
version: 1.17.3
version: 1.18.0
# The BindPlane OP tagged release. If the user does not
# set the `image.tag` values option, this version is used.
appVersion: 1.73.0
Expand Down
6 changes: 3 additions & 3 deletions charts/bindplane/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bindplane

![Version: 1.17.3](https://img.shields.io/badge/Version-1.17.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.73.0](https://img.shields.io/badge/AppVersion-1.73.0-informational?style=flat-square)
![Version: 1.18.0](https://img.shields.io/badge/Version-1.18.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.73.0](https://img.shields.io/badge/AppVersion-1.73.0-informational?style=flat-square)

BindPlane OP is an observability pipeline.

Expand Down Expand Up @@ -125,8 +125,8 @@ BindPlane OP is an observability pipeline.
| prometheus.enableSideCar | bool | `false` | When enabled, the Prometheus measurements backend will be deployed as a sidecar container. This option is only valid when BindPlane is running as a single node statefulset. |
| prometheus.extraPodLabels | object | `{}` | Optional arbitrary labels to add to the Prometheus pod. This option is only used when Prometheus is running as a StatefulSet managed by the chart (The default mode). |
| prometheus.host | string | `""` | The Prometheus hostname or IP address used for querying and writing metrics. Defaults to the service name of the Prometheus StatefulSet deployed by this chart. |
| prometheus.image.name | string | `"ghcr.io/observiq/bindplane-prometheus"` | Image name to be used. Defaults to `ghcr.io/observiq/bindplane-prometheus`. NOTE: The image tag is derived from the BindPlane server tag. |
| prometheus.image.tag | string | `""` | Image tag to use. Defaults to the bindplane version defined in the Chart's release. This option should be used when a specific bindplane-prometheus image is required, or if using upstream Prometheus. |
| prometheus.image.name | string | `"prom/prometheus"` | Image name to be used. |
| prometheus.image.tag | string | `"v2.54.1"` | Image tag to use. |
| prometheus.port | int | `9090` | The Prometheus TCP port used for querying and writing metrics. |
| prometheus.queryPathPrefix | string | `""` | Optional Prometheus query path prefix. Useful when overriding the query endpoints when using systems such as Mimir. |
| prometheus.remote | bool | `false` | When true, the chart will not deploy Prometheus. Instead, the user should provide a Prometheus instance to use. |
Expand Down
3 changes: 0 additions & 3 deletions charts/bindplane/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ The image tags to use
{{- define "bindplane.tag" -}}
{{- printf "%s" (default (printf "%s" .Chart.AppVersion) .Values.image.tag) }}
{{- end -}}
{{- define "prometheus.tag" -}}
{{- printf "%s" (default (printf "%s" .Chart.AppVersion) .Values.prometheus.image.tag) }}
{{- end -}}
Comment on lines -40 to -42
Copy link
Member Author

Choose a reason for hiding this comment

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

We used this helper to set the Prometheus image based on the Chartfile's application version (BindPlane's version). This is no longer nessisary because the values file has a default value for prometheus.image.tag.


{{/*
The Transform Agent image to use
Expand Down
54 changes: 53 additions & 1 deletion charts/bindplane/templates/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
{{- if not .Values.prometheus.remote }}
{{- if not .Values.prometheus.enableSideCar }}
apiVersion: v1
Copy link
Member Author

Choose a reason for hiding this comment

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

These configurations match our specification, which can be found here or within the BindPlane repository under package/prometheus.

kind: ConfigMap
metadata:
name: {{ include "bindplane.fullname" . }}-prometheus
data:
prometheus.yml: |
scrape_configs: []
rule_files: [/etc/prometheus/rules.yml]
web.yml: |
# This file should be empty unless configured
# by the user. See the Prometheus auth and TLS
# docs here: https://prometheus.io/docs/prometheus/latest/configuration/https/
rules.yml: |
groups:
- name: configuration-rollups
interval: 1m
rules:
- record: bindplane_agent_measurements:rollup:rate:1m
expr: sum without (agent) (rate(bindplane_agent_measurements{}[1m9s999ms] offset 10s))
- name: 5m-configuration-rollups
interval: 5m
rules:
- record: bindplane_agent_measurements:rollup:rate:5m
expr: sum without (agent) (rate(bindplane_agent_measurements:1m{}[5m59s999ms] offset 10s))
- name: 1h-configuration-rollups
interval: 1h
rules:
- record: bindplane_agent_measurements:rollup:rate:1h
expr: sum without (agent) (rate(bindplane_agent_measurements:15m{}[1h14m59s999ms] offset 10s))
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -50,7 +80,16 @@ spec:
{{- end }}
containers:
- name: prometheus
image: {{ .Values.prometheus.image.name }}:{{ include "prometheus.tag" . }}
image: {{ .Values.prometheus.image.name }}:{{ .Values.prometheus.image.tag }}
args:
Copy link
Member Author

Choose a reason for hiding this comment

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

These arguments match the args defined here.

- --config.file=/etc/prometheus/prometheus.yml
- --web.config.file=/etc/prometheus/web.yml
- --storage.tsdb.retention.time=2d
- --web.enable-remote-write-receiver
- --web.listen-address=:9090
- --storage.tsdb.path=/prometheus
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
Expand All @@ -70,6 +109,19 @@ spec:
volumeMounts:
- mountPath: /prometheus
name: {{ include "bindplane.fullname" . }}-prometheus-data
- mountPath: /etc/prometheus/prometheus.yml
subPath: prometheus.yml
name: config
- mountPath: /etc/prometheus/rules.yml
subPath: rules.yml
name: config
- mountPath: /etc/prometheus/web.yml
subPath: web.yml
name: config
volumes:
- name: config
configMap:
name: {{ include "bindplane.fullname" . }}-prometheus
persistentVolumeClaimRetentionPolicy:
whenDeleted: Retain
whenScaled: Retain
Expand Down
8 changes: 4 additions & 4 deletions charts/bindplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ backend:
# This is undocumented for now, as Prometheus support has not been released.
prometheus:
image:
# -- Image name to be used. Defaults to `ghcr.io/observiq/bindplane-prometheus`. NOTE: The image tag is derived from the BindPlane server tag.
name: "ghcr.io/observiq/bindplane-prometheus"
# -- Image tag to use. Defaults to the bindplane version defined in the Chart's release. This option should be used when a specific bindplane-prometheus image is required, or if using upstream Prometheus.
tag: ""
# -- Image name to be used.
name: "prom/prometheus"
# -- Image tag to use.
tag: "v2.54.1"
# -- When true, the chart will not deploy Prometheus. Instead, the user should provide a Prometheus instance to use.
remote: false
# -- When enabled, the Prometheus measurements backend will be deployed as a sidecar container. This option is only valid when BindPlane is running as a single node statefulset.
Expand Down
Loading