SwarmZero Docs
Main WebsitePricingGitHubDiscordX
  • GETTING STARTED
    • Welcome
    • Developing on SwarmZero
    • Quickstart
    • Key Concepts
      • AI
      • ML
      • LLM
      • AI Agents
      • Swarms
    • Contributing to SwarmZero
  • SDK
    • Agent Kit
    • Agent API Schema
    • Observability
      • Langtrace
      • OpenLIT
      • AgentOps
  • EXAMPLES
    • AI Agents
      • Build a Dune Agent with SwarmZero.ai
      • Build a News Agent with SwarmZero.ai using the GDELT API
      • Build a Uniswap Docs Retrieval Agent with SwarmZero.ai
      • Build an AAVE AI Agent to Lend and Borrow Crypto
      • Build & Monitor a Web Search Agent
      • Build a Multi-Chain Crypto Trading Telegram Bot with SwarmZero, Bitquery and DEXRabbit
    • Swarms
      • AI Researcher Swarm
      • Build a Web3 dApp with a Swarm of AI Agents
      • Livepeer Youtube Video Generator Swarm
    • Tools
      • Tools for Building Agents with Livepeer
      • Tools for Building Agents with Dune
      • YouTube Video Editor & Upload Tools
      • File Operations Tools
Powered by GitBook
LogoLogo

Quick Links

  • Main Website
  • Pricing
  • GitHub
  • Discord

© 2025 SwarmZero Technology Solutions Inc. All rights reserved.

On this page
  • Configuring Langtrace for SwarmZero
  • Setup
  • Install Langtrace
  • Add the Langtrace API Key

Was this helpful?

  1. SDK
  2. Observability

Langtrace

Monitoring Agents and Swarms with Langtrace

PreviousObservabilityNextOpenLIT

Last updated 5 months ago

Was this helpful?

is an open source observability and evaluations platform for AI Agents. You can use it to track vital LLM metrics, store & version control your prompts, compare the performance of your prompts across different models and much more.

Configuring Langtrace for SwarmZero

Setup

  1. Create a new project.

    1. Give it a name and description.

    2. Set the project type to Default.

Install Langtrace

pip install langtrace-python-sdk
  1. Import and initialize Langtrace before you import the SwarmZero SDK.

import os

from dotenv import load_dotenv
load_dotenv()

from langtrace_python_sdk import langtrace
langtrace.init(
    api_key=os.getenv("LANGTRACE_API_KEY", ""),
    disable_instrumentations={ "only": ["sqlalchemy"] }  # optional
)

from swarmzero import Agent

# ...

Add the Langtrace API Key

  1. Generate a Langtrace API Key from the Langtrace app dashboard.

    1. Select the Setup Project button on the newly created project card.

    2. Click Generate API Key and follow the on-screen instructions.

    3. Copy the API key.

  2. In the .env file of your SwarmZero project, add this:

LANGTRACE_API_KEY=<your_generated_api_key>
  1. Restart the agent server if you are using the agent.run() method.

    1. If not, just call agent.chat(...) again from your Python script.

First, .

Install the in your existing SwarmZero project.

Examples of Langtrace integration can be found in the .

signup on Langtrace
Python SDK for Langtrace
examples repository
Langtrace
Sample agent observability dashboard