Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Logging/tracing init: always-on console output, optional OTLP export.

Host processes (e.g. rship-control-plane) call init_from_env once at startup — before CellServer::builder()...build() — replacing the env_logger::init() call from before the log→tracing migration. See README.md’s Environment table for MYKO_TRACING_ENDPOINT / MYKO_MEM_PROFILE_INTERVAL_SECS.

Structs§

TelemetryGuard
Holds the OTLP provider handles alive for the process lifetime.

Functions§

init_from_env
Initialize logging/tracing from environment — the simple-case wrapper around otel_layer_from_env for host processes that don’t already compose their own tracing_subscriber (no existing fmt layer, no Tracy/ other tracing consumer to combine with — see otel_layer_from_env if you do).
otel_layer_from_env
Build just the OTLP trace layer (+ register the OTLP metrics MeterProvider globally, as a side effect) from MYKO_TRACING_ENDPOINT/ MYKO_MEM_PROFILE_INTERVAL_SECS — for host processes that compose their own tracing_subscriber::registry() (an existing custom fmt layer, a Tracy layer for live profiling sessions, etc.) instead of ceding the whole subscriber to init_from_env’s monolithic .init().
register_item_count_gauge
Registers an OTLP ObservableGauge reporting live per-entity-type item counts (myko.store.item_count, tagged entity_type) — the Rust equivalent of the old TS gateway’s itemCountsGuage/repo.getItemCount().
start_malloc_trim_probe
Periodic malloc_trim(0) probe: logs RSS before/after asking glibc to return free arena pages to the OS. Opt-in via MYKO_MALLOC_TRIM_INTERVAL_SECS (seconds); unset or 0 = disabled, no thread spawned.