You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(metrics): add configurable system prefix and separator (#6445)
* feat(metrics): add configurable system prefix to counter, gauge, and histogram macros
Replace the `__key_name!` macro with a `const fn __sep()` + `concatcp!`
approach so that both string literals and const paths (like `SYSTEM`)
work uniformly as the system prefix.
Each metric macro now accepts an optional `system:` argument. When
omitted, the system defaults to `$crate::SYSTEM` ("quickwit"). All
existing call sites continue to work without changes.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(metrics): add key name coverage for system and subsystem cases
Add explicit counter, gauge, and histogram tests for custom, default, empty, and const system/subsystem combinations, and assert emitted values for each case.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(metrics): add configurable metric name separator
Extend counter, gauge, and histogram base declaration macros to accept a configurable separator while defaulting to SEPARATOR, and add key-name tests for custom separators.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(metrics): add custom separator example in http_service
Show how to override the default metric name separator with "." in the example service and print the resulting dotted metric key.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: cargo fmt
* fix(metrics): allow separator override with default system
Add subsystem+separator macro arms for counter, gauge, and histogram so callers can customize separators without explicitly overriding system, and cover this with key-name tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
0 commit comments