Skip to main content

Module context_adapter

Module context_adapter 

Source
Expand description

Advanced context management for structured_logging

This module provides domain-specific context management capabilities that build on observability_core’s basic trace context foundation. It includes:

  • RAII scoped context management
  • Domain-specific context managers (LLM, A2A, Request)
  • Dependency injection registry
  • Advanced correlation features

Structs§

A2aContextGuard
RAII guard for A2A context
AllContextsGuard
Combined RAII guard for all contexts
LlmContextGuard
RAII guard for LLM context
RequestContextGuard
RAII guard for request context
ScopedContextBuilder
Scoped context builder for complex nested operations
StructuredA2aContextManager
Adapter implementing A2A context management for structured_logging
StructuredContextRegistry
Registry coordinating all structured_logging context managers
StructuredLlmContextManager
Adapter implementing LLM context management for structured_logging
StructuredRequestContextManager
Adapter implementing request context management for structured_logging

Traits§

A2aContextManager
Port (trait) for A2A context management
ContextManagerRegistry
Combined context manager that coordinates all context types
LlmContextManager
Port (trait) for LLM context management
RequestContextManager
Port (trait) for request context management

Functions§

init_context_integration
Initialize structured_logging context management integration
register_context_managers
Register a context manager registry (dependency injection)
set_a2a_context_scoped
Set A2A context with RAII guard
set_all_contexts_scoped
Set all contexts with combined RAII guard
set_llm_context_scoped
Set LLM context with RAII guard
set_request_context_scoped
Set request context with RAII guard
with_a2a_context
Execute a closure with A2A context, automatically clearing when done
with_all_contexts
Execute a closure with all contexts, automatically clearing when done
with_llm_context
Execute a closure with LLM context, automatically clearing when done
with_request_context
Execute a closure with request context, automatically clearing when done