Re-exportsΒ§
pub use token::Token;pub use token::TokenParseError;pub use token::TokenVerifyError;pub use token::UnauthenticatedToken;pub use token::load_bls_signing_key;pub use token::parse_bls_signing_key;
ModulesΒ§
- lifecycle π
- In-process OTel logs export plus a periodic Prometheus remote-write push for
metrics. Both pipelines share one six-month BLS-BN254 JWT minted from the
staking key. Tracing events go through an OTLP/HTTP batch exporter; an
externally supplied
prometheus::Registryis scraped on a tokio interval and POSTed to/api/v1/writeas snappy-compressed protobuf. - push_
task π - Periodic push of
prometheus::Registrysnapshots to a remote-write endpoint. A final flush runs on shutdown. Errors arewarn!-logged, never fatal; HTTP 429 triggers one shared ERROR viacrate::rate_limit::log_rate_limit_once. - rate_
limit π - Single-shot ERROR on the first HTTP 429 from the telemetry proxy, which caps
each nodeβs hourly byte budget. Only the metrics push observes 429 (logs
retry via opentelemetry-otlpβs
experimental-http-retry);compare_exchangeon the shared latch keeps it to one ERROR per process. - remote_
write - token
StructsΒ§
- Telemetry
Handle - Owns the OTel logger provider and, optionally, the metrics push task, so
both flush on graceful shutdown. Stashes the JWT and endpoint so the push
task can be spawned later via
TelemetryHandle::attach_metrics_pushonce the API setup has built theRegistry. - Telemetry
Options - Operator-facing telemetry configuration.
ConstantsΒ§
- NAME_
LABEL π
FunctionsΒ§
- build_
write_ request - encode_
to_ snappy - format_
float π - init
- Initialize the OTel logger pipeline and, when
registryisSome, spawn the metrics push immediately. Production passesNone(theRegistryisnβt built yet) and later callsTelemetryHandle::attach_metrics_push; tests pass it directly. - label_
pairs_ πto_ labels - make_
bucket_ πseries - make_
series π - named_
series π - now_
unix_ πmillis - registry
- Read the registry deposited by
set_registry.Noneif no API setup has run yet (tests, CLI tools without the HTTP module). - set_
registry - Deposit the
Registry. Idempotent: subsequent calls are no-ops, sinceOnceLock::setreturnsErr.