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

@agent-qa/traces-tempo

v0.1.0

Published

Grafana Tempo traces provider for agent-qa framework

Readme

@agent-qa/traces-tempo

Grafana Tempo traces provider for the agent-qa framework.

Installation

npm install @agent-qa/traces-tempo
# or
pnpm add @agent-qa/traces-tempo

Features

  • Implements the TracesProvider interface from @agent-qa/core
  • Fetch traces by ID or correlation ID
  • Search traces with filters (service, tags, time range)
  • Parse Tempo API responses into typed structures
  • Health check and status utilities

Usage with Agent-QA

The recommended way to use this package is with the agent-qa diagnostics config:

// agentqa.config.ts
import { defineConfig } from '@agent-qa/core';
import { createTempoProvider } from '@agent-qa/traces-tempo';

export default defineConfig({
  name: 'MyApp',
  agent: { /* ... */ },
  diagnostics: {
    traces: {
      provider: createTempoProvider({
        url: 'http://localhost:3200',
      }),
    },
  },
});

Standalone Usage

You can also use the provider directly:

import { createTempoProvider } from '@agent-qa/traces-tempo';

const provider = createTempoProvider({
  url: 'http://localhost:3200',
});

// Check if Tempo is reachable
const reachable = await provider.isReachable();

// Get trace by correlation ID
const trace = await provider.getTraceByCorrelationId('conv_abc123');

// Search traces
const results = await provider.searchTraces({
  service: 'my-api',
  limit: 20,
});

Low-Level API

For advanced use cases, you can use the low-level client functions directly:

Fetch a Trace

import { fetchTrace, parseTempoResponse } from '@agent-qa/traces-tempo';

const response = await fetchTrace('trace-id-here');
const trace = parseTempoResponse(response);

Search Traces

import { searchTraces, parseTimeRange } from '@agent-qa/traces-tempo';

const now = Math.floor(Date.now() / 1000);
const results = await searchTraces({
  service: 'my-api',
  start: now - parseTimeRange('1h'),
  end: now,
  limit: 20,
});

Search by Correlation ID

import { searchByCorrelationId } from '@agent-qa/traces-tempo';

// Find all traces for a specific conversation/session
const traces = await searchByCorrelationId('conv_abc123', {
  limit: 10,
  since: 3600, // seconds
});

Check Tempo Status

import { isTempoReachable, getStatus } from '@agent-qa/traces-tempo';

if (await isTempoReachable()) {
  const status = await getStatus();
  console.log('Tempo is healthy:', status);
}

Environment Variables

| Variable | Description | |----------|-------------| | TEMPO_URL | Tempo API endpoint (default: http://localhost:3200) | | TEMPO_TIMEOUT | Request timeout in ms (default: 30000) |

API Reference

Provider Factory

import { createTempoProvider, type TempoProviderConfig } from '@agent-qa/traces-tempo';

const provider = createTempoProvider({
  url?: string;      // Tempo server URL
  timeout?: number;  // Request timeout
});

Client Functions

import {
  fetchTrace,
  fetchTraces,
  searchTraces,
  searchByCorrelationId,
  getTraceByCorrelationId,
  isTempoReachable,
  getStatus,
  getConfig,
  parseTimeRange,
} from '@agent-qa/traces-tempo';

Parser

import { parseTempoResponse } from '@agent-qa/traces-tempo';

Types

import type {
  // Provider types (from @agent-qa/core)
  TracesProvider,
  TracesProviderStatus,
  TraceSearchOptions,

  // Domain types (from @agent-qa/core)
  ParsedTrace,
  ParsedSpan,
  TraceMetrics,
  TraceSearchResult,
  SpanType,
  SpanStatus,

  // Tempo-specific types
  TempoProviderConfig,
  TempoConfig,
  SearchOptions,
  TempoResponse,
  TempoSearchResult,
} from '@agent-qa/traces-tempo';

Custom Providers

This package provides a Tempo implementation of the TracesProvider interface. You can create your own providers for other backends (LangFuse, Jaeger, etc.):

import type { TracesProvider, ParsedTrace } from '@agent-qa/core/traces';

const myProvider: TracesProvider = {
  name: 'my-backend',

  async isReachable() {
    // Check if your backend is reachable
    return true;
  },

  async getTraceByCorrelationId(correlationId) {
    // Fetch and convert trace to ParsedTrace format
    return convertToParsedTrace(await fetchFromMyBackend(correlationId));
  },

  async searchTraces(options) {
    // Search your backend
    return convertToSearchResults(await searchMyBackend(options));
  },
};

License

MIT