autotel-testing
Test autotel instrumentation with createTraceCollector() and InMemorySpanExporter.
Skill by jagreehal
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jagreehal-autotel-testing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/autotel-testing
What's inside
- Skill name
autotel-testing- Description
- Test autotel instrumentation with createTraceCollector() and InMemorySpanExporter. Assert spans were created, attributes were set, errors were recorded. Use when writing tests for instrumented code.
- License
- Apache-2.0
- Instructions
- 333 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Autotel Testing
Test your autotel instrumentation to verify spans, attributes, errors, and events are emitted correctly.
## Purpose
Guide for writing tests that verify autotel instrumentation. Covers test utilities, assertion patterns, and complete examples.
## When to Use
- Writing tests for instrumented functions
- Verifying span names and attributes
- Testing structured error recording
- Testing request logger output
- Testing product events via track()
## Test Utilities
### createTraceCollector() (recommended)
High-level test utility that collects completed spans for assertion.
```typescript
import { createTraceCollector } from 'autotel/testing';
```
**API:**
- `collector.getSpans()`: returns all completed spans
- `collector.getSpanByName(name)`: find a span by name
- `collector.getSpansByName(name)`: find all spans with a name
- `collector.reset()`: clear collected spans
- `collector.shutdown()`: clean up resources
### createMemoryExporter()
Collects finished spans as plain objects, with no OpenTelemetry SDK types to
satisfy. Use it when you want to assert on span shape directly rather than go
through the collector.
```typescript
import { createMemoryExporter } from 'autotel/testing';
const exporter = createMemoryExporter();
// pass exporter to init(), then:
exporter.findSpan('checkout'); // one span, or undefined
exporter.findSpans('db.query'); // all matching spans
exporter.reset();
```
Each recorded span has `name`, `traceId`, `parentSpanId`, `durationMs`,
`attributes` and `status`.
### InMemorySpanExporter (low-level)
For custom test setups when you need direct access to the exporter.
```typescript
import { InMemorySpanExporter } from 'autotel/exporters';
```
## Test Setup
### With createTraceCollector (vitest)
```typescript
import { describe, it, expect, beforeEach, afterAll } from 'vitest';
import { createTraceCollector } from 'autotel/testing';
const collector = createTraceCollector();
beforeEach(() => {
collector.reset();
});
afterAll(async () => {
await collector.shutdown();
});
```
### File Naming Convention
- **Unit tests:** `*.test.ts`: test individual instrumented functions
- **Integration tests:** `*.integration.test.ts`: test full request flows with OTel SDK
Unit tests and integration tests use separate vitest configs in the autotel monorepo.
## Assertion Patterns
### Assert a Span Was Created
```typescript
import { trace } from 'autotel';
import { createTraceCollector } from 'autotel/testing';
const collector = createTraceCollector();
const getUser = trace(async (id: string) => {
return { id, name: 'Alice' };
});
it('creates a span for getUser', async () => {
collector.reset();
await getUser('123');
const spans = collector.getSpans();
expect(spans).toHaveLength(1);
expect(spans[0].name).toBe('getUser');
});
```
### Assert Span Attributes
```typescript
const processOrder = trace((ctx) => async (orderId: string, total: number) => {
ctx.setAttribute('order.id', orderId);
ctx.setAttribute('order.total', total);
return { success: true };
});From jagreehal/autotel, Apache-2.0.
More from jagreehal/autotel
- 0.631score
find-observability-gaps
jagreehal
Scores the observability of every entry point in a codebase with `autotel map` and closes the gaps it reports.
SkillAFreshness: A★ 8Claude Code +9 - 0.631score
build-audit-trails
jagreehal
Build or review tamper-aware audit trails on top of OpenTelemetry spans using autotel and the autotel-audit package (`withAudit`, `setAuditAttributes`…
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-anti-patterns
jagreehal
Common autotel mistakes and how to fix them.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-core
jagreehal
Explains when to reach for trace vs span vs request logger vs events in Autotel, and the package exports each lives behind.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
migrate-to-autotel
jagreehal
Migrate an existing observability setup to autotel.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
production-observability
jagreehal
Takes a Node.js or TypeScript service to production-grade observability with autotel, in an existing codebase or a new one, and keeps it there.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
design-alertable-metrics
jagreehal
Designs metrics an alarm can actually be written against — picking the attributes that let a rule isolate one failing dependency, pinning metric names as a…
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-investigate
jagreehal
Query OpenTelemetry telemetry (traces, metrics, logs, LLM analytics) via the autotel CLI.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-framework-setup
jagreehal
Set up autotel in Hono, Fastify, TanStack Start, Cloudflare Workers, Next.js, Express, MCP, and edge runtimes.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-request-logging
jagreehal
Accumulates request-scoped context and emits one wide-event snapshot per request with getRequestLogger(), set(), setLevel(), info/warn/error, and emitNow().
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-structured-errors
jagreehal
Throws and parses errors that explain themselves with message, why, fix, link, and status, including reusable catalogs via defineErrorCatalog.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
debug-missing-spans
jagreehal
Troubleshoot when expected OpenTelemetry spans don't reach the backend.
SkillAFreshness: A★ 8Claude Code +9
Signals
- Stars
- 8
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Aug 29, 2026 (2 months ago)
- Last release
- Sep 27, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/jagreehal/autotel
- Website
- jagreehal.github.io/autotel/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from jagreehal
- 0.631score
build-audit-trails
jagreehal
Build or review tamper-aware audit trails on top of OpenTelemetry spans using autotel and the autotel-audit package (`withAudit`, `setAuditAttributes`…
SkillAFreshness: A★ 8Claude Code +9 - 0.631score
find-observability-gaps
jagreehal
Scores the observability of every entry point in a codebase with `autotel map` and closes the gaps it reports.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-anti-patterns
jagreehal
Common autotel mistakes and how to fix them.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-core
jagreehal
Explains when to reach for trace vs span vs request logger vs events in Autotel, and the package exports each lives behind.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
autotel-investigate
jagreehal
Query OpenTelemetry telemetry (traces, metrics, logs, LLM analytics) via the autotel CLI.
SkillAFreshness: A★ 8Claude Code +9 - 0.626score
analyze-traces
jagreehal
Analyze OpenTelemetry traces and structured logs from a running autotel service to debug errors, investigate latency, follow requests across services, and…
SkillAFreshness: A★ 8Claude Code +9
Cite this page
autotel-testing skill. Agent Mart. https://agentmart.dev/skills/jagreehal-autotel-testing (last updated 2026-10-24)