The telemetry.py module#
Summary#
Pluggable telemetry sink. |
|
Default sink that writes one JSON line per event at the INFO level. |
|
Discard everything (used in tests where logging is noise). |
Return the default telemetry. |
|
Override the default sink. Pass |
Description#
Telemetry hook.
Centralized place to emit per-step events from MCP host interactions:
tool_call: Every tool invocationhost_turn: Every host round-trip, when the caller reports onevalidation_end: Final outcome of a validation request
Default implementation logs at INFO via logging in a structured
JSON line so consumers (such as Application Insights and OpenTelemetry collectors)
can scrape without installing extra dependencies. Replace via
set_default_telemetry() to forward elsewhere.