# Changelog of Metric Drop & Aggregation Recommender (`michiganpublictech/metric-usage-optimizer`) Actor

- **URL**: https://apify.com/michiganpublictech/metric-usage-optimizer/changelog.md
- **Full Actor documentation**: https://apify.com/michiganpublictech/metric-usage-optimizer.md

## Changelog — Metric Drop & Aggregation Recommender

### 0.1.0 — unreleased

- Initial version.
- Generated Collector processors validated against otelcol-contrib 0.115.1/0.150.1 (config validation and an
  end-to-end run); frozen as snapshot tests. Fix: histogram `_sum`/`_count` are extracted as non-monotonic sums
  (monotonic ones were exported as `<name>_sum_total`, breaking queries) and renamed to the Prometheus name when
  the inventory uses OTel names.
- Relabel regexes escape label values for RE2 (e.g. `route="/api/v1.0"`).
- New output `prometheus-remote-write`: `write_relabel_configs` that drop unused series and keep only the
  recorded series of aggregated metrics, merged into an existing `remote_write` section.
- MUO-HIST-002 suggests concrete bucket boundaries from the histogram's `le` values (kept per family from every
  inventory format, or `bucketBounds` in the list format), keeping SLO thresholds that `histogram_quantile`
  results are compared with, plus an OTel SDK view snippet.
- Existing filter-processor OTTL conditions are parsed and evaluated per metric (`and`/`or`/`not`, `metric.type`,
  `unit`, resource and data-point attributes); attribute-dependent conditions are reported as partial drops.
- Per-job attribution: `job`/`jobs` in the inventory (or a complete `job` label) scopes existing
  `metric_relabel_configs` per scrape job, and generated relabel rules only go to jobs that emit the metric.
- MUO-COST-003: estimated-savings summary line in REPORT.md.
- Performance: ~50k series / 1,000 dashboards analysed in about a second (cached label-need analysis, faster
  family grouping, libyaml emitter).
- PromQL parser (selectors, regex/UTF-8 names, aggregations, vector matching, set ops, functions, subqueries,
  offset/@) with top-down label-dependency analysis and a conservative fallback for unparsable queries.
- Inventory formats: metric list JSON/YAML, Prometheus series/names/metadata exports, TSDB status, OTLP/JSON,
  exposition text.
- Usage sources: Grafana dashboards (rows, collapsed rows, variables, macros), Prometheus/Mimir rule files
  (incl. PrometheusRule CRDs, ruler exports), query lists and query logs; transitive recording-rule usage.
- Recommendations: drop metric/family, aggregate labels, drop label values, drop histogram buckets/summary
  quantiles, bucket reduction, exponential histograms, interval increase, shared recording rules. Each comes
  with savings, confidence, evidence and risk notes.
- Generated OTel Collector processors (merged into a supplied config), Prometheus metric_relabel_configs,
  recording rules, vendor-neutral JSON and a phased rollout plan with verification queries.
- 61 rules (`MUO-*`). See [RULES.md](RULES.md).
- Pay-per-event: `metrics-analyzed` ($0.50) and `rules-generated` ($0.25). Unparsable inventories are free.
