feat: add prometheus-adapter metrics component - #208
Draft
savme wants to merge 2 commits into
Draft
Conversation
scotwells
reviewed
Aug 5, 2026
Comment on lines
+14
to
+20
| sum by (<<.GroupBy>>) ( | ||
| rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>,container!="",container!="POD"}[2m]) | ||
| ) | ||
| nodeQuery: | | ||
| sum by (<<.GroupBy>>) ( | ||
| rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>,id="/"}[2m]) | ||
| ) |
Contributor
There was a problem hiding this comment.
Thinking we have these metrics be standardized around datum's naming for instances? Like datum_compute_instance_cpu_usage_seconds_total.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a Prometheus Adapter component for
metrics.k8s.io.The idea is to test whether we can make HPA CPU/memory scaling work by having runtimes publish resource usage into Prometheus or VictoriaMetrics. Prometheus Adapter can then serve the standard Kubernetes Resource Metrics API, and HPAs can keep using normal Resource metrics.
The component is not enabled by default. It adds the reusable deployment pieces: adapter Deployment, Service, RBAC, serving cert, APIService, and resource metric rules. Infra overlays are expected to decide where to install it and patch the Prometheus/VM URL and cert issuer.
Telemetry needs to produce the following metrics shape:
container_cpu_usage_seconds_total{namespace, pod, container, node}container_memory_working_set_bytes{namespace, pod, container, node}This does not make kraftlet HPA work on its own. It only wires the compute-side adapter component. The remaining work is to produce and ingest the runtime metrics.
Related to datum-cloud/enhancements#799