Crate hyperactor_telemetry

Source

Re-exports§

pub use opentelemetry;

Modules§

env
in_memory_reader
recorder
sqlite
trace

Macros§

declare_observable_gauge
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.
declare_static_counter
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.
declare_static_gauge
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.
declare_static_histogram
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.
declare_static_timer
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).
declare_static_up_down_counter
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.
key_value
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.
kv_pairs
Construct the key value attribute slice using mapping syntax. Example:

Structs§

DefaultTelemetryClock
Key
The key part of attribute KeyValue pairs.
KeyValue
A key-value pair describing an attribute.
Level
Describes the level of verbosity of a span or event.
Timer
TimerGuard

Enums§

TimeUnit
Value
The value part of attribute KeyValue pairs.

Constants§

DISABLE_OTEL_METRICS
Environment variable to disable the OpenTelemetry logging layer. Set to “1” to disable OpenTelemetry metrics.
DISABLE_OTEL_TRACING
Environment variable to disable the OpenTelemetry logging layer. Set to “1” to disable OpenTelemetry tracing.
DISABLE_RECORDER_TRACING
Environment variable to disable the recorder logging layer. Set to “1” to disable the recorder output.

Traits§

TelemetryClock

Functions§

initialize_logging
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.
initialize_logging_with_log_prefix
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.
log_file_path
meter
Creates a named [Meter] via the currently configured global [MeterProvider].
recorder
The recorder singleton that is configured as a layer in the the default tracing subscriber, as configured by initialize_logging.
swap_telemetry_clock
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.