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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Alloy `ClusterRole` is narrowed to `pods`, `nodes` and `nodes/metrics`. It no longer grants read access to `secrets` and `configmaps`. If you add components through `alloy.extraBlocks` that need more access, override `alloy.rbac.rules` and `alloy.rbac.clusterRules`.
- `node_uname_info` carries the Kubernetes node name in its `nodename` label instead of the OS hostname, so dashboards that match it against `kube_node_info`'s `node` work when nodes are named by instance ID.
- BREAKING: `kube-state-metrics` and `prometheus-node-exporter` are now top-level subcharts instead of dependencies of the `prometheus` subchart, so they can run without the Prometheus server. Move any overrides from `prometheus.kube-state-metrics:` and `prometheus.prometheus-node-exporter:` to top-level `kube-state-metrics:` and `prometheus-node-exporter:`. With default values the rendered manifests are unchanged. The chart now fails to render if an old-style override is still set under `prometheus.`, instead of silently ignoring it. `prometheus-node-exporter` is pinned to 4.56.1 and no longer follows the `prometheus` chart's version; bump it by hand.
- New `global.telemetry.metrics.remoteWriteURL` points the collector at a Prometheus outside this release. It can then be combined with `prometheus.enabled: false`, which previously failed to render. Empty by default, which keeps writing to the bundled Prometheus. With the bundled Prometheus disabled, the Loki ruler's remote-write URL and Grafana's `metrics` datasource still point at it, so also disable Loki and Grafana (or override those URLs), and note that the release's own alert rules are not evaluated. The receiving Prometheus needs `--web.enable-remote-write-receiver` (and `--enable-feature=native-histograms` if `global.telemetry.metrics.native_histograms` is on), and each writing cluster needs a distinct `global.telemetry.metrics.externalLabels` (for example `cluster`), or series from different clusters collide. For authentication, TLS, headers or queue tuning, set `global.telemetry.metrics.remoteWriteExtraConfig` to extra Alloy configuration for the `endpoint` block (read secrets with `sys.env("NAME")`); the chart's own relabelling and `externalLabels` stay in place.

## v0.3.0

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,12 @@ values which are defined [here](https://github.com/grafana/helm-charts/tree/main
| global.externalZone | string | `"svc.cluster.local"` | |
| global.postgres | object | `{"alerts":{"groups":{"Basic":{"delay":"1m","enabled":true},"Connections":{"delay":"5m","enabled":true,"thresholds":{"critical":0.9,"notify":0.5,"warning":0.8}},"Notifications":{"delay":"15m","enabled":true,"thresholds":{"critical":0.9,"notify":0.5,"warning":0.8}}}},"database":"coder","exporter":{"enabled":true,"image":"quay.io/prometheuscommunity/postgres-exporter"},"hostname":"localhost","mountSecret":"secret-postgres","password":null,"port":5432,"sslmode":"disable","sslrootcert":null,"username":"coder","volumeMounts":[],"volumes":[]}` | postgres connection information NOTE: these settings are global so we can parameterise some values which get rendered by subcharts |
| global.postgres.alerts | object | `{"groups":{"Basic":{"delay":"1m","enabled":true},"Connections":{"delay":"5m","enabled":true,"thresholds":{"critical":0.9,"notify":0.5,"warning":0.8}},"Notifications":{"delay":"15m","enabled":true,"thresholds":{"critical":0.9,"notify":0.5,"warning":0.8}}}}` | alerts for postgres |
| global.telemetry | object | `{"metrics":{"externalLabels":{},"native_histograms":false,"scrape_interval":"15s","scrape_timeout":"12s"},"profiling":{"scrape_interval":"60s","scrape_timeout":"70s"}}` | control telemetry collection |
| global.telemetry.metrics | object | `{"externalLabels":{},"native_histograms":false,"scrape_interval":"15s","scrape_timeout":"12s"}` | control metric collection |
| global.telemetry | object | `{"metrics":{"externalLabels":{},"native_histograms":false,"remoteWriteExtraConfig":"","remoteWriteURL":"","scrape_interval":"15s","scrape_timeout":"12s"},"profiling":{"scrape_interval":"60s","scrape_timeout":"70s"}}` | control telemetry collection |
| global.telemetry.metrics | object | `{"externalLabels":{},"native_histograms":false,"remoteWriteExtraConfig":"","remoteWriteURL":"","scrape_interval":"15s","scrape_timeout":"12s"}` | control metric collection |
| global.telemetry.metrics.externalLabels | object | `{}` | labels added to every series the collector writes, e.g. `cluster: my-cluster` |
| global.telemetry.metrics.native_histograms | bool | `false` | enable Prometheus native histograms or default to classic histograms |
| global.telemetry.metrics.remoteWriteExtraConfig | string | `""` | extra Alloy configuration placed inside the `endpoint` block of `prometheus.remote_write`, e.g. `basic_auth`, `bearer_token`, `tls_config`, `headers` or `queue_config` (see https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.remote_write/#endpoint-block). Rendered with `tpl`, so it can use Helm values; read secrets with `sys.env("NAME")` (supply the variable via the collector's environment) rather than putting them here. Do not set `url` here, use `remoteWriteURL`. The chart's own `write_relabel_config` rules and `externalLabels` stay in place. |
| global.telemetry.metrics.remoteWriteURL | string | `""` | Prometheus remote-write endpoint the collector sends to, e.g. `http://prometheus.example.com/api/v1/write`. Empty means the bundled Prometheus. Set it, and `prometheus.enabled: false`, to collect in this cluster but store elsewhere. Loki's ruler and Grafana's datasource still target the bundled Prometheus, so disable them too. The receiver needs `--web.enable-remote-write-receiver` (and `--enable-feature=native-histograms` if `native_histograms` is on), and each cluster needs its own `externalLabels`. For authentication, TLS or queue tuning, use `remoteWriteExtraConfig`. |
| global.telemetry.metrics.scrape_interval | string | `"15s"` | how often the collector will scrape discovered pods |
| global.telemetry.metrics.scrape_timeout | string | `"12s"` | how long a request will be allowed to wait before being canceled |
| global.telemetry.profiling.scrape_interval | string | `"60s"` | how often the collector will scrape pprof endpoints |
Expand Down
10 changes: 10 additions & 0 deletions coder-observability/templates/_collector-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,17 @@ prometheus.remote_write "default" {
{{ end }}
endpoint {
send_native_histograms = {{ .Values.global.telemetry.metrics.native_histograms | default false }}
{{- $remoteWriteURL := .Values.global.telemetry.metrics.remoteWriteURL | default "" | toString | trim }}
Comment thread
jtslear marked this conversation as resolved.
Resolved
{{- if $remoteWriteURL }}
url = {{ $remoteWriteURL | quote }}
{{- else if not .Values.prometheus.enabled }}
{{- fail "global.telemetry.metrics.remoteWriteURL is required when prometheus.enabled is false" }}
{{- else }}
url ="http://{{ include "prometheus.server.fullname" .Subcharts.prometheus }}.{{ .Release.Namespace }}.{{ .Values.global.zone }}/api/v1/write"
{{- end }}
{{- with .Values.global.telemetry.metrics.remoteWriteExtraConfig }}
{{ tpl . $ | indent 4 }}
{{- end }}

// drop instance label which unnecessarily adds new series when pods are restarted, since pod IPs are dynamically assigned
// NOTE: "__address__" is mapped to "instance", so will contain <hostname>:<port>
Expand Down
4 changes: 4 additions & 0 deletions coder-observability/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ global:
native_histograms: false
# global.telemetry.metrics.externalLabels -- labels added to every series the collector writes, e.g. `cluster: my-cluster`
externalLabels: {}
# global.telemetry.metrics.remoteWriteURL -- Prometheus remote-write endpoint the collector sends to, e.g. `http://prometheus.example.com/api/v1/write`. Empty means the bundled Prometheus. Set it, and `prometheus.enabled: false`, to collect in this cluster but store elsewhere. Loki's ruler and Grafana's datasource still target the bundled Prometheus, so disable them too. The receiver needs `--web.enable-remote-write-receiver` (and `--enable-feature=native-histograms` if `native_histograms` is on), and each cluster needs its own `externalLabels`. For authentication, TLS or queue tuning, use `remoteWriteExtraConfig`.
remoteWriteURL: ""
# global.telemetry.metrics.remoteWriteExtraConfig -- extra Alloy configuration placed inside the `endpoint` block of `prometheus.remote_write`, e.g. `basic_auth`, `bearer_token`, `tls_config`, `headers` or `queue_config` (see https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.remote_write/#endpoint-block). Rendered with `tpl`, so it can use Helm values; read secrets with `sys.env("NAME")` (supply the variable via the collector's environment) rather than putting them here. Do not set `url` here, use `remoteWriteURL`. The chart's own `write_relabel_config` rules and `externalLabels` stay in place.
remoteWriteExtraConfig: ""
profiling:
# global.telemetry.profiling.scrape_interval -- how often the collector will scrape pprof endpoints
scrape_interval: 60s
Expand Down
Loading