> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Observability CLI

> CLI commands for 14+ observability integrations in PraisonAI TypeScript

# Observability CLI Commands

The `praisonai-ts` CLI provides comprehensive commands for managing 14+ observability integrations.

## Command Overview

| Command                       | Description                               |
| ----------------------------- | ----------------------------------------- |
| `observability list`          | List all 14+ available tools              |
| `observability doctor`        | Check environment variables for all tools |
| `observability doctor <tool>` | Check specific tool setup                 |
| `observability test <tool>`   | Test tool with a trace                    |
| `observability info`          | Show observability feature information    |

## List Observability Tools

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List all available tools
praisonai-ts observability list

# List with verbose output (shows env vars)
praisonai-ts observability list --verbose

# Get JSON output for CI/CD
praisonai-ts observability list --json
```

**Example Output:**

```
Observability Tools

  Total: 17 tools (3 ready)

  Built-in (no setup required):
    ✅ console      Console logging adapter
    ✅ memory       In-memory storage adapter
    ✅ noop         No-op adapter (zero overhead)

  External Integrations:
    ⚠️ langfuse     Langfuse LLM observability
    ⚠️ langsmith    LangChain observability platform
    ⚠️ langwatch    LangWatch monitoring
    ⚠️ arize        Arize AX Phoenix observability
    ⚠️ axiom        Axiom log analytics
    ⚠️ braintrust   Braintrust AI evaluation
    ⚠️ helicone     Helicone LLM proxy
    ⚠️ laminar      Laminar AI observability
    ⚠️ maxim        Maxim AI testing
    ⚠️ patronus     Patronus AI evaluation
    ⚠️ scorecard    Scorecard AI testing
    ⚠️ signoz       SigNoz OpenTelemetry
    ⚠️ traceloop    Traceloop OpenLLMetry
    ⚠️ weave        Weights & Biases Weave
```

**JSON Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "success": true,
  "data": {
    "providers": [
      { "name": "langfuse", "description": "Langfuse LLM observability", "hasEnvKey": false },
      { "name": "langsmith", "description": "LangChain observability platform", "hasEnvKey": false },
      { "name": "console", "description": "Console logging adapter", "hasEnvKey": true }
    ],
    "total": 17,
    "ready": 3,
    "builtin": 3,
    "external": 14
  }
}
```

## Observability Doctor

Check environment setup for tools:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Check all tools
praisonai-ts observability doctor

# Check specific tool
praisonai-ts observability doctor langfuse
praisonai-ts observability doctor langsmith
praisonai-ts observability doctor arize

# JSON output
praisonai-ts observability doctor langfuse --json
```

**Example Output (specific tool):**

```
Observability Doctor: langfuse
  Description: Langfuse LLM observability
  Package: langfuse
  Environment Variable: LANGFUSE_SECRET_KEY
  Status: ❌ Missing API Key

  Set the API key with:
    export LANGFUSE_SECRET_KEY=your-api-key

  Features:
    Traces: ✅  Spans: ✅  Events: ✅
    Errors: ✅  Metrics: ✅  Export: ✅
```

**Example Output (all tools):**

```
Observability Environment Check

  Total Tools: 17
  Ready: 3 ✅

  Ready Tools:
    ✅ console
    ✅ memory
    ✅ noop
```

## Observability Test

Test a tool with a real trace:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Test built-in tools (no API key needed)
praisonai-ts observability test memory
praisonai-ts observability test console

# Test external tools (requires API key)
praisonai-ts observability test langfuse
praisonai-ts observability test langsmith

# JSON output
praisonai-ts observability test memory --json
```

**Example Output:**

```
Testing memory observability...

  ✅ Test Passed
  Tool: memory
  Latency: 2ms
  Trace ID: abc123xyz
```

**JSON Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "success": true,
  "data": {
    "tool": "memory",
    "status": "success",
    "latency_ms": 2,
    "trace_id": "abc123xyz"
  }
}
```

## Observability Info

Get feature information:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts observability info
praisonai-ts observability info --json
```

## Options Matrix

| Option              | Description                      | Default |
| ------------------- | -------------------------------- | ------- |
| `--json`            | Output in JSON format            | false   |
| `--verbose`         | Show detailed output             | false   |
| `--output <format>` | Output format (json/text/pretty) | pretty  |
| `--tool <name>`     | Specify tool                     | -       |

## Available Tools

| Tool         | Description                | Env Variable           |
| ------------ | -------------------------- | ---------------------- |
| `langfuse`   | Langfuse LLM observability | `LANGFUSE_SECRET_KEY`  |
| `langsmith`  | LangChain observability    | `LANGCHAIN_API_KEY`    |
| `langwatch`  | LangWatch monitoring       | `LANGWATCH_API_KEY`    |
| `arize`      | Arize AX Phoenix           | `ARIZE_API_KEY`        |
| `axiom`      | Axiom log analytics        | `AXIOM_TOKEN`          |
| `braintrust` | Braintrust AI evaluation   | `BRAINTRUST_API_KEY`   |
| `helicone`   | Helicone LLM proxy         | `HELICONE_API_KEY`     |
| `laminar`    | Laminar AI observability   | `LMNR_PROJECT_API_KEY` |
| `maxim`      | Maxim AI testing           | `MAXIM_API_KEY`        |
| `patronus`   | Patronus AI evaluation     | `PATRONUS_API_KEY`     |
| `scorecard`  | Scorecard AI testing       | `SCORECARD_API_KEY`    |
| `signoz`     | SigNoz OpenTelemetry       | `SIGNOZ_ACCESS_TOKEN`  |
| `traceloop`  | Traceloop OpenLLMetry      | `TRACELOOP_API_KEY`    |
| `weave`      | Weights & Biases Weave     | `WANDB_API_KEY`        |
| `console`    | Console logging            | (none)                 |
| `memory`     | In-memory storage          | (none)                 |
| `noop`       | No-op (zero overhead)      | (none)                 |

## Environment Variables

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Langfuse
export LANGFUSE_PUBLIC_KEY=pk-...
export LANGFUSE_SECRET_KEY=sk-...
export LANGFUSE_HOST=https://cloud.langfuse.com

# LangSmith
export LANGCHAIN_API_KEY=ls-...
export LANGCHAIN_PROJECT=my-project

# LangWatch
export LANGWATCH_API_KEY=...

# Arize AX (Phoenix)
export ARIZE_API_KEY=...

# Axiom
export AXIOM_TOKEN=...
export AXIOM_DATASET=ai-traces

# Braintrust
export BRAINTRUST_API_KEY=...

# Helicone
export HELICONE_API_KEY=...

# Laminar
export LMNR_PROJECT_API_KEY=...

# Maxim
export MAXIM_API_KEY=...

# Patronus
export PATRONUS_API_KEY=...

# Scorecard
export SCORECARD_API_KEY=...

# SigNoz
export SIGNOZ_ACCESS_TOKEN=...
export SIGNOZ_ENDPOINT=...

# Traceloop
export TRACELOOP_API_KEY=...

# Weave (W&B)
export WANDB_API_KEY=...
export WANDB_PROJECT=my-project
```

## Troubleshooting

### Missing API Key

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Check which keys are missing
praisonai-ts observability doctor

# Check specific tool
praisonai-ts observability doctor langfuse
# Output: ❌ Missing API Key
# Set it with: export LANGFUSE_SECRET_KEY=your-api-key
```

### Tool Not Available

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Check if tool package is installed
praisonai-ts observability doctor langfuse
# If package missing, install with:
# npm install langfuse
```

### Test Failures

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Run test with verbose output
praisonai-ts observability test langfuse --verbose

# Check JSON error details
praisonai-ts observability test langfuse --json
```

## SDK Usage

For programmatic observability:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { 
  createObservabilityAdapter, 
  setObservabilityAdapter,
  OBSERVABILITY_TOOLS,
  listObservabilityTools 
} from 'praisonai';

// List all tools
const tools = listObservabilityTools();
console.log(tools.map(t => t.name)); // ['langfuse', 'langsmith', ...]

// Create adapter
const obs = await createObservabilityAdapter('langfuse');
setObservabilityAdapter(obs);

// Use with agents
const agent = new Agent({
  instructions: 'You are helpful.'
});
await agent.chat('Hello');

// Flush traces
await obs.flush();
```

## Related

* [Observability SDK](/docs/js/observability) - Code-based observability usage
* [Telemetry](/docs/js/telemetry) - Performance metrics
* [Evaluation](/docs/js/evaluation) - Test Agent quality
