Skip to main content
Telemetry tracks anonymous usage counts when agents run — no prompts, responses, or personal data.
The user runs an agent as usual; anonymous run metrics are recorded automatically unless telemetry is opted out.

How It Works

Quick Start

1

Install Package

Install PraisonAI Agents:
Note: Telemetry is included by default and automatically enabled unless disabled.
2

Simple Example

Create simple_agent_example.py:
3

Check Telemetry (Optional)

Access telemetry metrics programmatically:
4

Disable Telemetry (Optional)

To disable telemetry, set any of these environment variables before running:
5

Enable Telemetry Explicitly (Optional)

To enable telemetry via environment variable (required since telemetry is off by default):

What is Tracked

PraisonAI telemetry collects only minimal, anonymous metrics:

Usage Metrics

  • Number of agent executions
  • Number of task completions
  • Tool usage (names only)
  • Error types (no messages)

Environment Info

  • Framework version
  • Python version
  • Operating system type
  • Anonymous session ID
Privacy Guarantee: No personal data, prompts, responses, or user content is ever collected. Only anonymous usage metrics are tracked.

Disabling Telemetry

Telemetry can be disabled in multiple ways: Opt-out (any of these disables telemetry):
Opt-in (required since telemetry is off by default):
CLI Integration: As of PR #1552, PraisonAI respects pre-existing OTEL_SDK_DISABLED environment variables instead of overwriting them. Telemetry initialization now runs from cli.PraisonAI.__init__ (explicit call to _ensure_telemetry_defaults()), not from the lazy __getattr__ hook in praisonai/__init__.py. This means importing praisonai no longer touches the filesystem or os.environ; only constructing PraisonAI(...) does. Initialization is also thread-safe (uses threading.Lock).

Enabling / Disabling Telemetry Programmatically

Precedence: Explicit environment opt-out always wins. Setting DO_NOT_TRACK=true (or any of the *_DISABLED flags above) makes enable_telemetry() a no-op. Otherwise, the most recent programmatic call decides the state. With neither set, telemetry is off by default until enable_telemetry() is called or PRAISONAI_TELEMETRY_ENABLED=true / PRAISONAI_PERFORMANCE_ENABLED=true is exported.

Langfuse + opt-out coexistence

Users now have full control over telemetry settings when using Langfuse for other applications:
This addresses the issue where PraisonAI previously overwrote explicit user opt-outs when Langfuse environment variables were present.

How Telemetry Works

Telemetry in PraisonAI is automatic and minimal:
  1. Automatic Integration: When you create agents and run workflows, telemetry is automatically integrated
  2. Anonymous Tracking: Only counts and types are tracked, never content
  3. Memory Storage: Currently metrics are only stored in memory (no network calls)
  4. Session-based: Each run gets a unique anonymous session ID
  5. Privacy-first: Respects DO_NOT_TRACK standard and multiple opt-out methods

Advanced Usage

Accessing Telemetry Data

Manual Tracking (Advanced)

Integration with External Services

PostHog Integration (Coming Soon)

PraisonAI telemetry includes built-in PostHog support for anonymous analytics:

AgentOps Integration

For more advanced monitoring, you can use AgentOps alongside the built-in telemetry:

Backward Compatibility

The telemetry module maintains compatibility with the previous interface:

Best Practices

  • Telemetry is designed to be minimal and privacy-focused
  • No personal data, prompts, or responses are ever collected
  • Always respect user preferences for tracking
  • Use environment variables for easy opt-out
  • Telemetry has minimal overhead
  • Metrics are stored in memory only (no network calls in current version)
  • Automatic integration means no extra code needed
  • PostHog integration (when available) uses async mode to prevent blocking

Troubleshooting

Telemetry Not Working

If telemetry isn’t tracking:
  • Check environment variables aren’t disabling it
  • Verify telemetry.enabled is True
  • Check debug logs with LOGLEVEL=DEBUG
  • Ensure you’re using the latest version
  • If you call enable_telemetry() but hooks still don’t fire, check whether an opt-out env var (DO_NOT_TRACK, PRAISONAI_TELEMETRY_DISABLED, PRAISONAI_DISABLE_TELEMETRY, PRAISONAI_PERFORMANCE_DISABLED) is set — those always win

Privacy Concerns

If you have privacy concerns:
  • Review what’s tracked (only anonymous metrics)
  • Disable telemetry via environment variables
  • Check the source code for transparency
  • No network calls in current implementation

Next Steps

Monitoring

Explore AgentOps integration for advanced monitoring

Cost Tracking

Learn about detailed latency and cost tracking

Gateway Tracing Hook

Emit OpenTelemetry spans across each gateway pipeline stage
PraisonAI telemetry is designed to be minimal, privacy-focused, and helpful. It collects only anonymous usage metrics to help improve the framework while respecting user privacy. Telemetry can be easily disabled at any time.

Stream structured lifecycle events to your own observability stack.

Hook into agent events to log, measure, or react in code.