Create a thread safe static observable gauge that can be set to a specific value based on the provided callback.
This is useful for metrics that need to be calculated or retrieved dynamically.
The callback will be executed whenever the gauge is observed by the metrics system.
Create a thread safe static counter that can be incremeneted or decremented.
This is useful to avoid creating temporary counters.
You can safely create counters with the same name. They will be joined by the underlying
runtime and are thread safe.
Create a thread safe static gauge that can be set to a specific value.
This is useful to avoid creating temporary gauges.
You can safely create gauges with the same name. They will be joined by the underlying
runtime and are thread safe.
Create a thread safe static histogram that can be incremeneted or decremented.
This is useful to avoid creating temporary histograms.
You can safely create histograms with the same name. They will be joined by the underlying
runtime and are thread safe.
Create a thread safe static timer that can be used to measure durations.
This macro creates a histogram with predefined boundaries appropriate for the specified time unit.
Supported units are “ms” (milliseconds), “us” (microseconds), and “ns” (nanoseconds).
Create a thread safe static counter that can be incremeneted or decremented.
This is useful to avoid creating temporary counters.
You can safely create counters with the same name. They will be joined by the underlying
runtime and are thread safe.
Create key value pairs for use in opentelemetry. These pairs can be stored and used multiple
times. Opentelemetry adds key value attributes when you bump counters and histograms.
so MY_COUNTER.add(42, &[key_value!(“key”, “value”)]) and MY_COUNTER.add(42, &[key_value!(“key”, “other_value”)]) will actually bump two separete counters.
Set up logging based on the given execution environment. We specialize logging based on how the
logs are consumed. The destination scuba table is specialized based on the execution environment.
mast -> monarch_tracing/prod
devserver -> monarch_tracing/local
unit test -> monarch_tracing/test
scuba logging won’t normally be enabled for a unit test unless we are specifically testing logging, so
you don’t need to worry about your tests being flakey due to scuba logging. You have to manually call initialize_logging()
to get this behavior.
Set up logging based on the given execution environment. We specialize logging based on how the
logs are consumed. The destination scuba table is specialized based on the execution environment.
mast -> monarch_tracing/prod
devserver -> monarch_tracing/local
unit test -> monarch_tracing/test
scuba logging won’t normally be enabled for a unit test unless we are specifically testing logging, so
you don’t need to worry about your tests being flakey due to scuba logging. You have to manually call initialize_logging()
to get this behavior.
Hotswap the telemetry clock at runtime. This allows changing the clock implementation
after initialization, which is useful for testing or switching between real and simulated time.