Skip to main content
ProvenLog offers two zero-friction approaches that automatically detect and instrument all installed frameworks. No per-framework setup code required.

plog run — CLI wrapper

Wraps any Python command with automatic instrumentation:

How it works

plog run creates a temporary sitecustomize.py (the standard Python startup hook used by ddtrace, OpenTelemetry, etc.) that imports provenlog.auto, then executes your command with a modified PYTHONPATH. Python automatically runs sitecustomize on startup — before your code runs — so all frameworks are patched before any agent code imports them. The child process inherits stdin/stdout/stderr transparently. Signals (SIGINT, SIGTERM) are forwarded. The child’s exit code is preserved.

Flags

import provenlog.auto — one-line import

For code you control, add a single import at the top of your entrypoint:

What happens on import

  1. Reads configuration from environment variables
  2. Creates a shared ProvenLogClient
  3. Probes for installed frameworks using importlib.util.find_spec() (never imports uninstalled packages)
  4. Patches each detected framework using its native hook mechanism

Environment variables

Framework detection

If LangGraph is detected, the separate LangChain patch is skipped — LangGraph’s Trail extends LangChain’s and captures both graph-level and chain-level events.

Safety

  • Framework detection uses importlib.util.find_spec() — it never imports uninstalled packages
  • Each patch is wrapped in try/except — if one framework fails to patch, the others still work
  • The client is registered with atexit for clean shutdown
  • ProvenLog observes passively — it never modifies agent behavior and adds zero latency to the execution path