mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 12:16:03 +09:00
fix(kubernetes, monitoring): send tenant cluster metrics to the tenant's vminsert
The monitoring-agents chart reads vmagent.remoteWrite.urls as a list and
takes the tenant label from global.target, while the kubernetes app still
passed a single remoteWrite.url and vmagent.externalLabels.tenant. Both
keys were dropped in silence, so the vmagent of every tenant cluster fell
back to the chart defaults: it wrote to vminsert services in
cozy-monitoring that do not exist inside the tenant cluster, queued the
failed writes on the node disk, and labelled every series
tenant="cozy-monitoring". No tenant cluster metric reached the tenant's
Monitoring.
The tenant label has to name the tenant that owns the cluster, which is
not always the tenant whose Monitoring receives the data: a tenant
without its own Monitoring inherits a parent's.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 55d6c52fab)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
1 parent
70cff7d374
commit
423a75bb31
4 files changed
+110
-2
No files matched your search
@@ -45,7 +45,8 @@ spec:
|
||||
cluster: {{ .Release.Name }}
|
||||
tenant: {{ .Release.Namespace }}
|
||||
remoteWrite:
|
||||
url: http://vminsert-shortterm.{{ $targetTenant }}.svc.{{ $clusterDomain }}:8480/insert/0/prometheus
|
||||
urls:
|
||||
- http://vminsert-shortterm.{{ $targetTenant }}.svc.{{ $clusterDomain }}:8480/insert/0/prometheus
|
||||
fluent-bit:
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
suite: monitoring-agents HelmRelease values match the monitoring-agents chart
|
||||
|
||||
# The values below are consumed by packages/system/monitoring-agents, which
|
||||
# reads vmagent.remoteWrite.urls as a list and the tenant label from
|
||||
# vmagent.externalLabels.tenant. A key the chart does not read is dropped in
|
||||
# silence, and the chart then falls back to cozy-monitoring defaults that do
|
||||
# not resolve inside a tenant cluster. Its counterpart is
|
||||
# packages/system/monitoring-agents/tests/vmagent_remote_write_test.yaml.
|
||||
templates:
|
||||
- templates/helmreleases/monitoring-agents.yaml
|
||||
|
||||
values:
|
||||
- values/common.yaml
|
||||
|
||||
release:
|
||||
name: kubernetes-clusterprod
|
||||
namespace: tenant-a
|
||||
|
||||
set:
|
||||
addons.monitoringAgents.enabled: true
|
||||
_namespace.monitoring: tenant-root
|
||||
_cluster:
|
||||
cluster-domain: cozy.local
|
||||
|
||||
tests:
|
||||
- it: sends metrics to the shortterm vminsert of the monitoring tenant as a urls list
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.vmagent.remoteWrite
|
||||
value:
|
||||
urls:
|
||||
- http://vminsert-shortterm.tenant-root.svc.cozy.local:8480/insert/0/prometheus
|
||||
|
||||
- it: labels series with the tenant that owns the cluster, not the monitoring tenant
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.vmagent.externalLabels
|
||||
value:
|
||||
cluster: kubernetes-clusterprod
|
||||
tenant: tenant-a
|
||||
- notExists:
|
||||
path: spec.values.global
|
||||
Reference in new issue
Block a user