npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fiddler-ai/otel

v0.1.1

Published

OpenTelemetry-based tracing SDK for Fiddler AI observability

Readme

@fiddler-ai/otel

OpenTelemetry-based tracing SDK for Fiddler AI Observability. Instrument your AI agents, LLM calls, and tool invocations in TypeScript/JavaScript and send traces to Fiddler.

Mirrors the Python fiddler-otel SDK — same span types, same attribute names, same transport.

Installation

npm install @fiddler-ai/otel

Peer dependency — install alongside it:

npm install @opentelemetry/api

Requirements: Node.js ≥ 20

Quick Start

import { randomUUID } from 'crypto'
import { FiddlerClient } from '@fiddler-ai/otel'

const client = new FiddlerClient({
  url: 'https://your-instance.fiddler.ai',
  apiKey: 'your-api-key',
  applicationId: 'your-app-uuid',  // UUID4 from Fiddler UI
})

const sessionId = randomUUID()

// Root agent span — becomes the session in the Fiddler UI
const agent = client.startAgent('travel-agent')
agent.setAgentName('travel-agent')
agent.setConversationId(sessionId)
agent.setInput('Book a flight to Paris')

// LLM call
const llm = client.startGeneration('plan-trip', { parent: agent })
llm.setModel('gpt-4o')
llm.setInput('Plan a 5-day Paris trip')
llm.setOutput('Day 1: Eiffel Tower...')
llm.setUsage({ inputTokens: 500, outputTokens: 300 })
llm.end()

// Tool call
const tool = client.startTool('search-flights', { parent: agent })
tool.setToolName('search_flights')
tool.setInput({ destination: 'Paris', date: '2026-06-01' })
tool.setOutput({ flights: ['AF123', 'BA456'] })
tool.end()

agent.setOutput('Trip planned and flights found.')
agent.end()

await client.flush()

API Reference

new FiddlerClient(config)

| Option | Type | Required | Description | |--------|------|----------|-------------| | url | string | ✅ | Base URL of your Fiddler instance | | apiKey | string | ✅ | Fiddler API key | | applicationId | string | ✅ | Application UUID from the Fiddler UI | | serviceName | string | — | OTel service.name resource attribute (default: fiddler-otel) | | serviceVersion | string | — | OTel service.version resource attribute (default: 0.1.0) | | consoleTracer | boolean | — | If true, also prints spans to stdout for local debugging (default: false) |

Span Creation Methods

All methods return a typed span and accept an optional { parent } to establish hierarchy.

client.startAgent(name, { parent? })       // → FiddlerAgentSpan      (type: chain)
client.startGeneration(name, { parent? })  // → FiddlerGenerationSpan  (type: llm)
client.startTool(name, { parent? })        // → FiddlerToolSpan        (type: tool)
client.startSpan(name, { parent?, type? }) // → FiddlerSpan            (generic)

FiddlerAgentSpan

span.setAgentName(name: string)        // gen_ai.agent.name
span.setAgentId(id: string)            // gen_ai.agent.id
span.setConversationId(id: string)     // gen_ai.conversation.id
span.setInput(data: unknown)           // fiddler.span.input (JSON)
span.setOutput(data: unknown)          // fiddler.span.output (JSON)
span.setAttribute(key, value)          // custom attribute
span.recordError(error)                // records exception + sets ERROR status
span.end()                             // ends the span with OK status

FiddlerGenerationSpan

span.setModel(model: string)                          // gen_ai.request.model
span.setSystem(provider: string)                      // gen_ai.system
span.setSystemPrompt(text: string)                    // gen_ai.llm.input.system
span.setUserPrompt(text: string)                      // gen_ai.llm.input.user
span.setInput(input: string | unknown)                // gen_ai.llm.input.user
span.setCompletion(text: string)                      // gen_ai.llm.output
span.setOutput(output: string | unknown)              // gen_ai.llm.output
span.setContext(context: string)                      // gen_ai.llm.context (RAG)
span.setUsage({ inputTokens, outputTokens, totalTokens? })
span.setMessages(messages: object[])                  // gen_ai.input.messages (JSON)
span.setOutputMessages(messages: object[])            // gen_ai.output.messages (JSON)
span.setToolDefinitions(definitions: object[])        // gen_ai.tool.definitions (JSON)

FiddlerToolSpan

span.setToolName(name: string)                        // gen_ai.tool.name
span.setInput(input: unknown)                         // gen_ai.tool.input (JSON)
span.setOutput(output: unknown)                       // gen_ai.tool.output (JSON)
span.setToolDefinitions(definitions: object[])        // gen_ai.tool.definitions (JSON)

Lifecycle Methods

await client.flush()     // Force-flush all buffered spans to Fiddler
await client.shutdown()  // Flush then shut down the provider

flush() is called automatically on beforeExit (when the event loop drains naturally). For SIGINT/SIGTERM, call flush() explicitly in your signal handler:

process.once('SIGINT', async () => {
  await client.flush()
  process.exit(130)
})

One FiddlerClient per process is the expected usage — mirroring the Python SDK.

How It Works

FiddlerClient
  └── BasicTracerProvider (isolated — does not touch global OTel)
        ├── FiddlerSpanProcessor   → propagates conversation_id / agent_name to child spans
        └── BatchSpanProcessor
              └── OTLPTraceExporter
                    └── POST {url}/v1/traces
                          Authorization: Bearer {apiKey}
                          fiddler-application-id: {applicationId}

Spans are buffered in memory and sent together in a single HTTP request when flush() is called. This ensures the backend receives the complete trace and can build the correct parent-child hierarchy.

Multi-Agent Example

const sessionId = randomUUID()

// Root supervisor — becomes the session
const supervisor = client.startAgent('supervisor')
supervisor.setAgentName('supervisor')
supervisor.setConversationId(sessionId)
supervisor.setInput('Book flight + hotel')

// Sub-agent
const flightAgent = client.startAgent('flight-assistant', { parent: supervisor })
flightAgent.setAgentName('flight_assistant')

  const llm = client.startGeneration('flight-llm', { parent: flightAgent })
  llm.setModel('gpt-4o-mini')
  llm.setInput('Find flights BOS → JFK')
  llm.setOutput('Calling book_flight tool')
  llm.setUsage({ inputTokens: 85, outputTokens: 28 })
  llm.end()

  const tool = client.startTool('book-flight', { parent: flightAgent })
  tool.setToolName('book_flight')
  tool.setInput({ from: 'BOS', to: 'JFK' })
  tool.setOutput('Flight booked.')
  tool.end()

flightAgent.setOutput('Flight booked.')
flightAgent.end()

supervisor.setOutput('All done.')
supervisor.end()

await client.flush()

License

Apache-2.0