Telemetry and observability functions for monitoring agent performance
pip install praisonaiagents[telemetry]
Optional[TelemetryCollector]
: The current telemetry collector instance, or None if telemetry is disabledlevel
(str, optional): Telemetry level (“minimal”, “basic”, “detailed”). Defaults to “minimal”custom_collector
(TelemetryCollector, optional): Custom telemetry collector instanceexport_endpoint
(str, optional): Endpoint for exporting telemetry dataexport_interval
(int, optional): Export interval in seconds. Defaults to 60include_prompts
(bool, optional): Include prompt content in telemetry. Defaults to Falseinclude_results
(bool, optional): Include result content in telemetry. Defaults to FalseTelemetryCollector
: The enabled telemetry collector instance"minimal"
: Basic metrics only (counts, timings)"basic"
: Includes error information and performance metrics"detailed"
: Full telemetry including traces and detailed metricsname
(str): Metric namevalue
(Union[int, float]): Metric valueunit
(str, optional): Unit of measurementlabels
(Dict[str, str], optional): Additional labels for the metricname
(str): Event nameattributes
(Dict[str, Any], optional): Event attributesservice_name
(str, optional): Name of the service. Defaults to “praisonai”service_version
(str, optional): Service versionexport_endpoint
(str, optional): OpenTelemetry export endpointexport_interval
(int, optional): Export interval in secondsenable_traces
(bool, optional): Enable trace collection. Defaults to Trueenable_metrics
(bool, optional): Enable metrics collection. Defaults to Trueenable_logs
(bool, optional): Enable log collection. Defaults to Truename
(str): Span namekind
(str, optional): Span kind (“internal”, “client”, “server”). Defaults to “internal”attributes
(Dict[str, Any], optional): Span attributesagent_name
(str): Name of the agentduration
(float): Execution duration in secondsstatus
(str): Execution status (“success”, “failure”, “partial”)error
(str, optional): Error message if failedmetadata
(Dict[str, Any], optional): Additional metadatatool_name
(str): Name of the toolagent_name
(str): Name of the agent using the toolduration
(float): Tool execution durationsuccess
(bool): Whether the tool execution was successfulparameters
(Dict[str, Any], optional): Tool parameters (if include_prompts is enabled)PRAISONAI_TELEMETRY_ENABLED
: Enable/disable telemetry (“true”/“false”)PRAISONAI_TELEMETRY_LEVEL
: Set telemetry level (“minimal”/“basic”/“detailed”)PRAISONAI_TELEMETRY_ENDPOINT
: Set export endpointPRAISONAI_TELEMETRY_EXPORT_INTERVAL
: Set export interval in secondsPRAISONAI_TELEMETRY_INCLUDE_PROMPTS
: Include prompts in telemetry (“true”/“false”)PRAISONAI_TELEMETRY_INCLUDE_RESULTS
: Include results in telemetry (“true”/“false”)