OctoWiki
Memory Appendix

Metrics Dimensions

All business metrics must include client_id and product_id attributes for Grafana drill-down

Source memory file: feedback_metrics_dimensions.md · Category: Feedback / working-preference This is a verbatim dump of Claude's persistent memory for the Octopus project. Rendered inside a code block so nothing is altered.

---
name: Metrics drill-down dimensions
description: All business metrics must include client_id and product_id attributes for Grafana drill-down
type: feedback
---

All business metrics (orders, wallet, topups, vouchers, vendor API calls) must include `client_id` and `product_id` as OTel attributes wherever available, so Grafana dashboards can drill down by client and/or product.

**Why:** The user needs per-client and per-product visibility in dashboards — aggregate-only metrics are insufficient for their monitoring needs.

**How to apply:** When recording any `metrics.OTel.*` instrument, always attach `attribute.String("client_id", ...)` and `attribute.String("product_id", ...)` when those values are available in scope. Use string type for both (even though they're uint64 internally) for Prometheus label compatibility.