Expand description
§metricus-macros
Contains macros.
Attribute Macros§
- counter
- The
counterattribute macro instruments a function with a metrics counter, allowing you to measure how many times a function is called. It requires to specifymeasurementname under which the count will be recorded. It also accepts optionaltagsrepresented as comma-separated list of key-value tuples such astags(key1 = "value1", key2 = "value2"). The function name (fn_name) is automatically added as a tag, so there is no need to include it manually. All keys must be unique. - counter_
with_ id - The
counter_with_idattribute macro instruments a function with a metrics counter with a user supplied id. This can be useful to provide instrumentation for memory allocators where we need to ‘defer’ metric registration until the backend has been registered. - span
- The
spanattribute macro instruments a function with a metrics span that will be recorded using a histogram, allowing you to measure how long a given function took to execute in nanoseconds. It requires to specifymeasurementname under which the count will be recorded. It also accepts optionaltagsrepresented as comma-separated list of key-value tuples such astags(key1 = "value1", key2 = "value2"). The function name (fn_name) is automatically added as a tag, so there is no need to include it manually. All keys must be unique.