Skip to content

feat: add prometheus-adapter metrics component - #208

Draft
savme wants to merge 2 commits into
mainfrom
feat/hpa-prom-adapter
Draft

feat: add prometheus-adapter metrics component#208
savme wants to merge 2 commits into
mainfrom
feat/hpa-prom-adapter

Conversation

@savme

@savme savme commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

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])
)

@scotwells scotwells Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking we have these metrics be standardized around datum's naming for instances? Like datum_compute_instance_cpu_usage_seconds_total.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! 2d1c252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants