feat: add aggregationMethod field to DiscoveryPolicy PrometheusSource#50
feat: add aggregationMethod field to DiscoveryPolicy PrometheusSource#50Copilot wants to merge 7 commits into
Conversation
|
@copilot make sure the e2e tests Cover this as well to see if it Works against a Real prometheus endpoint. Seed the prometheus accordingly with metrics that make sense. If necessary also deploy kubestatemetrics or anything else we need. Im Addition Update the documentation. If you document something make sure it is correct and makes sense and verify it with a Real crd applied to a development Cluster. The documentation May never contain something that is not verified. Add that to the llm instructions as well of this repository. Document your findings im this PR. |
…dd verification rule
Done in d32b360...latest. Here's what was added: E2E tests (
Documentation (
LLM instructions (
No kube-state-metrics deployment was needed — the Prometheus recording rules already simulate the necessary container metrics for testing. |
Adds an
aggregationMethodfield to the PrometheusSource configuration in DiscoveryPolicy, allowing users to choose how range query data points are combined into a ranking score whenlookbackis set.Changes Made
CRD & Core Logic
AggregationMethodenum type (sum,count,avg,max) onPrometheusSourceinapi/v1alpha1/discoverypolicy_types.goaggregateRangeValuesreplacessumRangeValuesininternal/discovery/prometheus.gowith method-based dispatchE2E Tests (
test/e2e/discovery-aggregation/)e2e-infrahack/e2e-infra/prometheus-config.yaml— newseed_aggregation_metricsrule group withcontainer_cpu_usage_seconds_totalusing varying pod counts and values per imageReady/Syncedstatus and correct image countDocumentation (
docs/content/docs/discovery.md)aggregationMethod: countfor popularity-based rankingLLM Instructions
make docs-genAggregation Methods
sum(default)countavgmax