Skip to main content

AgentOps Integration

AgentOps provides agent monitoring, debugging, and optimization.
AgentOps is treated as a soft optional dependency. If the package isn’t installed, PraisonAI skips telemetry without raising; if end_session() fails at runtime, the failure is logged as a warning and the agent run still returns its result.

Setup

1. Install Dependencies

2. Set Environment Variables

3. Initialize

How Integration Works

  • AgentOps is optional: if pip install agentops hasn’t been run, PraisonAI silently skips session telemetry.
  • After every agent execution — on both success and failure paths — the wrapper calls praisonai.observability.hooks.finalize_observability(adapter_name, status=…) from a finally block. status is "Success" when no exception is propagating and "Failure" otherwise (errors, KeyboardInterrupt, cancellation, rate limits). Failures inside the end-session call are logged at WARNING level and never propagate.
  • Detection happens once at module import via importlib.util.find_spec("agentops"). Installing agentops after the process started will not be picked up — restart the process.
  • PraisonAI auto-inits AgentOps for you if AGENTOPS_API_KEY is set in the environment. The init is centralized in praisonai.observability.hooks.init_observability(framework_tag, tags=...) and is called automatically by the orchestrator before any adapter runs. You can call it yourself from a custom framework adapter’s setup() hook if you need control over the tags.
See Observability Hooks for details on the centralized observability system and how to use it in custom adapters. The centralized finalize_observability(...) hook is documented in Observability Hooks → Quick Start.

Usage

Explicit Tracing (For Fine Control)

Configuration Options

OptionEnvironment VariableDescription
api_keyAGENTOPS_API_KEYYour AgentOps API key
tags-Default tags for sessions
auto_start_session-Auto-start session (default: True)

Dashboard

View your agent sessions at app.agentops.ai