Skip to main content

Crate astrid_telemetry

Crate astrid_telemetry 

Source
Expand description

Astrid Telemetry - Logging and tracing for the Astrid secure agent runtime.

This crate provides:

  • Configurable logging setup with multiple formats
  • Request context for correlation across operations
  • Integration with the tracing ecosystem

§Example

use astrid_telemetry::{LogConfig, LogFormat, setup_logging, RequestContext};

// Set up logging
let config = LogConfig::new("debug")
    .with_format(LogFormat::Pretty)
    .with_directive("astrid_mcp=trace");

setup_logging(&config)?;

// Create a request context
let ctx = RequestContext::new("my_component")
    .with_operation("process_request");

// Use the context's span for tracing
let span = ctx.span();
let _guard = span.enter();
tracing::info!("Processing request");

Modules§

prelude
Prelude module - commonly used types for convenient import.

Structs§

LogConfig
Logging configuration.
RequestContext
Request context for correlation across operations.

Enums§

LogFormat
Log format options.
LogTarget
Log output target.
TelemetryError
Errors that can occur with telemetry operations.

Functions§

setup_logging
Set up logging with the given configuration.

Type Aliases§

TelemetryResult
Result type for telemetry operations.