Loading...
Loading...
Create and manage Oodle metric drop rules — reduce ingestion cost by dropping or sampling high-volume, low-value metrics.
npx skill4agent add oodle-ai/agent-skills oodle-drop-rulesbrew install oodle-ai/oodle/oodle
oodle configureoodle drop-rules list -o json | jq 'length'oodle metrics list --match <prefix> -o json | jq 'length'oodle dashboards list -o json | jq '.[] | select(.panels[]?.query | contains("<metric>"))'oodle monitors list -o json | jq '.[] | select(.query | contains("<metric>"))'action: samplesampleRate: 0.1action: dropoodle drop-rules create -f rule.json| Task | Command |
|---|---|
| List rules | |
| Get rule | |
| Create rule | |
| Update rule | |
| Delete rule | |
{
"name": "drop-noisy-debug-metrics",
"matchers": [
{"name": "level", "value": "debug"},
{"name": "env", "value": "staging"}
],
"action": "drop",
"sampleRate": null
}| Field | Meaning |
|---|---|
| All matchers must match for the rule to fire (logical AND) |
| |
| Required when |
# ✅ CORRECT — count series that will be affected
oodle metrics list --match "debug_" -o json | jq 'length'
# ✅ CORRECT — confirm no dashboard panel queries the metric
oodle dashboards list -o json | jq '.[] | select(.panels[]?.query | contains("debug_traffic_total"))'
# ✅ CORRECT — confirm no monitor depends on it
oodle monitors list -o json | jq '.[] | select(.query | contains("debug_traffic_total"))'
# ❌ WRONG — create the rule first, find out from on-call later
oodle drop-rules create -f rule.jsonsample{
"name": "sample-debug-metrics-staging",
"matchers": [
{"name": "__name__", "value": "debug_traffic_total"},
{"name": "env", "value": "staging"}
],
"action": "sample",
"sampleRate": 0.1
}# ✅ CORRECT — keep 10% of the series; observe for a week before dropping
oodle drop-rules create -f rule.jsonsampledrop# ✅ CORRECT — get → switch action → update
oodle drop-rules get dr_123 -o json > rule.json
jq '.action = "drop" | .sampleRate = null' rule.json > rule.new.json
oodle drop-rules update dr_123 -f rule.new.json
# ❌ WRONG — partial payload nulls matchers
oodle drop-rules update dr_123 -f <(echo '{"action":"drop"}')# ✅ CORRECT
oodle drop-rules get dr_123 -o json > /dev/null
oodle drop-rules delete dr_123 --force
# ❌ WRONG — speculative delete by name match
oodle drop-rules delete "$(oodle drop-rules list | grep debug | awk '{print $1}')" --forceoodle metrics list --match <prefix> -o json | jq 'length'# ✅ CORRECT
oodle metrics list --match "kube_pod_" -o json | jq 'length'
# 1742 series — confirm with the team that all 1742 are safe to drop before creating a rule
# ❌ WRONG — create rule based on a guess; later discover a critical metric was matched
oodle drop-rules create -f rule.jsonaction: samplesampleRate: 0.1# ✅ CORRECT — week 1: sample at 10%, observe dashboards
"action": "sample", "sampleRate": 0.1
# week 2: if no dashboards or monitors regressed, switch to drop
"action": "drop", "sampleRate": null
# ❌ WRONG — drop on first attempt; can break a dashboard nobody remembered
"action": "drop"envservice__name__{level: debug}# ✅ CORRECT — scoped to one env
"matchers": [{"name":"level","value":"debug"},{"name":"env","value":"staging"}]
# ❌ WRONG — also drops debug metrics in prod
"matchers": [{"name":"level","value":"debug"}]getupdate# ✅ CORRECT
oodle drop-rules get dr_123 -o json > rule.json
jq '.sampleRate = 0.05' rule.json > rule.new.json
oodle drop-rules update dr_123 -f rule.new.json
# ❌ WRONG — drops matchers and action
oodle drop-rules update dr_123 -f <(echo '{"sampleRate":0.05}')<action>-<metric-or-domain>-<scope># ✅ CORRECT
"name": "drop-debug-metrics-staging"
"name": "sample-kube-pod-info-prod"
# ❌ WRONG
"name": "rule1"| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or missing API key | Run |
| 404 Not Found | Drop rule ID does not exist | Verify with |
| connection refused | Wrong | Check |
| | Add |
| Dashboard panel suddenly empty | Drop rule matched a metric the panel queries | Run |
Monitor went into | Drop rule matched the monitor's metric | Same fix as above; alternatively switch the rule from |
| Cost did not decrease | Matchers don't actually match the high-volume series | Re-run |
| 429 Too Many Requests | Bulk drop-rule sync | Add |