Build1 publisher3 min readPublished
A governance tag push turned five EKS workers into Prometheus scrape targets
The environment and techteam tags that drive cost allocation also drive Prometheus EC2 service discovery, so an add-only tagging run in ap-south-1 enrolled Kubernetes nodes in a scrape job for a host agent they do not run.
The Engineer · Build desk

What happened
- A September 8 org-wide AWS governance push applied a standard tag schema, including environment and techteam, across prod VPCs in ap-south-1 for cost allocation, ownership, compliance and inventory.
- A central Prometheus job finds host telegraf through EC2 service discovery, filtering on tag:environment=prod plus a regex over platform-team techteam values.
- Five EKS worker instances picked up environment=prod and a matching techteam value, entered the scrape pool, and sat permanently at up=0 under a critical Telegraf Down rule.
- Prometheus showed roughly nine telegraf targets down plus a kafka exporter and a redis exporter, all in one alert family, with at least three unrelated causes underneath.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- constraint A tag schema owned by finance and compliance is also input to the scrape config, so a per-VPC tagging ticket can rewrite monitoring topology with no monitoring review attached to it.
- exposure Five permanently red criticals under a shared rule name make that rule cheap to ignore, and the two genuinely broken AL2023 hosts were sitting inside the same batch.
- decision Anyone running Prometheus EC2 service discovery has to pick between keying it on business tags and keying it on a tag the monitoring team owns; the EKS-managed tags already on the nodes give a third option that leaves governance alone.
The add-only rule was supposed to prevent this class of surprise. `techteam` was left unset at the ASG level because the rule said to use existing values only, and the EKS nodegroup ASG did not have one [4]. The running workers came up with `techteam`, `Application`, `environment` and `businessunit` anyway. The write-up attributes that to EKS nodegroup or launch template tagging tied to the same governance work, not to anything overwriting an older value [5]. The guard sat on the ASG script, and the tags reached the instances by a different path.
EC2 service discovery re-queries the tags on every refresh. It asks EC2 which instances carry the tags, then scrapes port 9273 on whatever comes back [6]. Writing a tag is a change to the scrape topology. EKS workers are EC2 instances, and they matched the filter as soon as the tags landed [7]. Those nodes report through in-cluster DaemonSets or cAdvisor, and nothing on them listens on 9273 [8], so the five new targets could only ever report `up=0` [9].
"From a compliance perspective, that looked fine. From a monitoring perspective, we had just told Prometheus these were prod platform hosts," the author wrote [14].
Five of the roughly nine down telegraf targets came from the tag write, about 56 percent of the batch [18]. Two were a real break, on new AL2023 instances where the telegraf RPM was installed but the `prometheus_client` output was commented out, so the agent logged "no outputs found" and had nothing to expose on the scrape port [11]. Fixes for AL2023 telegraf were already in the ansible repo; those hosts had no ansible-pull cron, so ansible-pull never ran to template `telegraf.conf` [12]. The account itemises seven of the nine [19].
The kafka target is a third defect firing under the same alert name. Its exporter on 9308 had been disabled for months while telegraf on 9278 on the same host was fine, and by the author's account the alert rule conflated exporter health with agent health [13]. "I started grouping targets by hostname and role before touching anything, which turned out to be the only reason we didn't make things worse," the author wrote [15]. Nine criticals arrived under one rule name on the Thursday morning, three days after the tagging [17].
For this to reach another fleet, the discovery job has to key on the same tag names the finance and compliance schema writes, and the Kubernetes nodes have to sit in the accounts and regions the tagging run covers. A job keyed on a tag the monitoring team owns would have kept the same targets through the run. The cheap exclusion was already on the instances: the nodegroup ASG carried `eks:cluster-name`, `eks:nodegroup-name` and `k8s.io/cluster/*` before September 8 [3]. A drop rule on `eks:cluster-name` in the EC2 SD config keeps those hosts out of the pool with no change to the governance schema. The five worker targets were still unfixed when the account was captured [16].
What to watch
- Whether the fix lands in the scrape config or in the tag schema, since only one of those needs a change ticket per VPC.
- Whether the redis exporter target turns out to be a fourth root cause or another discovery artefact.
- Whether new AL2023 ASG instances get an ansible-pull cron in the image, so the next launch templates telegraf.conf on boot.