From 58649103e5551d67ebf9b0cc7ccc86396989e255 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sun, 31 Aug 2025 14:39:24 -0400 Subject: [PATCH] Improve metric.hpp documentation --- src/metric.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/metric.hpp b/src/metric.hpp index 1770db5..c00e300 100644 --- a/src/metric.hpp +++ b/src/metric.hpp @@ -164,7 +164,6 @@ private: }; // Factory functions for creating metric families -// IMPORTANT: name and help must point to static memory (string literals) // Create counter family (monotonically increasing values) // ERROR: Aborts if family with same name is registered with different help @@ -205,9 +204,9 @@ std::vector exponential_buckets(double start, double factor, int count); // Returns chunks of Prometheus exposition format (includes # HELP and # TYPE // lines) Each string_view may contain multiple lines separated by '\n' String // views are NOT null-terminated - use .size() for length All string data -// allocated in provided arena for zero-copy efficiency -// TODO: Implement Prometheus text exposition format -// THREAD SAFETY: Serialized by global mutex - callbacks need not be thread-safe +// allocated in provided arena for zero-copy efficiency. The caller is +// responsible for the arena's lifecycle. THREAD SAFETY: Serialized by global +// mutex - callbacks need not be thread-safe std::span render(ArenaAllocator &arena); // Validation functions for Prometheus compatibility