microsoft.opentelemetry.a365.hosting package

Microsoft Agent 365 Observability Hosting Library.

class microsoft.opentelemetry.a365.hosting.BaggageMiddleware[source]

Bases: object

Middleware that propagates OpenTelemetry baggage context derived from TurnContext.

Async replies (ContinueConversation) are passed through without baggage setup.

async on_turn(context, logic)[source]
Return type:

None

class microsoft.opentelemetry.a365.hosting.OutputLoggingMiddleware[source]

Bases: object

Middleware that creates OutputScope spans for outgoing messages.

Links to a parent span when A365_PARENT_TRACEPARENT_KEY is set in turn_state.

Privacy note: Outgoing message content is captured verbatim as span attributes and exported to the configured telemetry backend.

async on_turn(context, logic)[source]
Return type:

None

class microsoft.opentelemetry.a365.hosting.ObservabilityHostingManager[source]

Bases: object

Singleton manager for configuring hosting-layer observability middleware.

Example

ObservabilityHostingManager.configure(adapter.middleware_set, ObservabilityHostingOptions(
    enable_output_logging=True,
))
classmethod configure(middleware_set, options)[source]

Configure the singleton instance and register middleware.

Subsequent calls after the first are no-ops and return the existing instance.

Parameters:
  • middleware_set (MiddlewareSet) – The middleware set to register middleware on (e.g., adapter.middleware_set).

  • options (ObservabilityHostingOptions) – Configuration options controlling which middleware to enable.

Return type:

ObservabilityHostingManager

Returns:

The singleton ObservabilityHostingManager instance.

Raises:

TypeError – If middleware_set or options is None.

class microsoft.opentelemetry.a365.hosting.ObservabilityHostingOptions(enable_baggage=False, enable_output_logging=False)[source]

Bases: object

Configuration options for the hosting observability layer.

enable_baggage: bool = False

Enable baggage propagation middleware. Defaults to False.

enable_output_logging: bool = False

Enable output logging middleware for tracing outgoing messages. Defaults to False.

Subpackages