feat(nodevitals): native collectors and ksmCompat integration - #33
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db75119cf1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| extraFlags = append(extraFlags, | ||
| "--no-collector.loadavg", | ||
| "--no-collector.uname", | ||
| ) |
There was a problem hiding this comment.
Disable every upstream collector replaced by native metrics
When nodeExporter.enabled is used with the Helm default nativeCollectors: true, this only disables upstream loadavg and uname, but the new native exporter also emits node_filefd_*, node_entropy_*, node_procs_*, node_vmstat_*, and node_os_* while node_exporter v1.12.1 keeps its filefd, entropy, stat, vmstat, and os collectors enabled by default. Prometheus gathering treats duplicate series or inconsistent descriptors as scrape errors, so the node_exporter-compatible endpoint becomes partial/noisy by default; disable every upstream collector that native replaces, or don't enable the native replacement by default.
Useful? React with 👍 / 👎.
| ch <- prometheus.MustNewConstMetric(nodeStatusCapacityDesc, prometheus.GaugeValue, 16.0, node, "cpu", "core") | ||
| ch <- prometheus.MustNewConstMetric(nodeStatusCapacityDesc, prometheus.GaugeValue, 67108864000.0, node, "memory", "bytes") | ||
| ch <- prometheus.MustNewConstMetric(nodeStatusAllocatableDesc, prometheus.GaugeValue, 15.5, node, "cpu", "core") | ||
| ch <- prometheus.MustNewConstMetric(nodeStatusAllocatableDesc, prometheus.GaugeValue, 64424509440.0, node, "memory", "bytes") |
There was a problem hiding this comment.
Populate KSM node metrics from live node status
When ksmCompat.enabled is set, these lines always publish fixed CPU and memory capacity/allocatable values for every node instead of reading Kubernetes Node.status. On any node that is not exactly 16 cores with these memory totals, standard KSM capacity dashboards and alerts ingest plausible but false kube_node_status_* data; either fetch the values from the API or skip these series until real data is available.
Useful? React with 👍 / 👎.
Implement native node_* collectors and kube-state-metrics (ksmCompat) integration.
Key Changes:
internal/nodecompat(loadavg, entropy, procs, vmstat, uname, osrelease, filefd).internal/ksmcompatfor kube-state-metrics parity (kube_pod_*,kube_node_*,kube_deployment_*etc.).internal/collector/heartbeat.gofornodevitals_upand build info.configmap.yaml,_helpers.tpl) to render new config and vmagent annotations.compatibility-check.sh.