Skip to content
Agentmart
Submit a tool

autotel-anti-patterns

Common autotel mistakes and how to fix them.

Skill by jagreehal

IndexedApache-2.0★ 8
Write a review

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-anti-patterns

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.

We use your email only for this newsletter. Privacy

About

Common autotel mistakes and how to fix them. Wrong init patterns, manual span lifecycle, scattered console.log, generic Error throws, missing emitNow(), wrong import paths, secrets in attributes, barrel re-exports. Use when reviewing code or debugging instrumentation issues.

Use cases: security

No 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-anti-patterns

What's inside

Skill name
autotel-anti-patterns
Description
Common autotel mistakes and how to fix them. Wrong init patterns, manual span lifecycle, scattered console.log, generic Error throws, missing emitNow(), wrong import paths, secrets in attributes, barrel re-exports. Use when reviewing code or debugging instrumentation issues.
License
Apache-2.0
Instructions
392 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Autotel Anti-Patterns

Common mistakes when using autotel, why they're wrong, and how to fix them.

## Purpose

Quick reference for catching and fixing incorrect autotel usage. Each anti-pattern includes the bad code, why it's wrong, the correct code, and a one-line rationale.

## When to Use

- Reviewing code that uses autotel
- Debugging instrumentation issues
- Teaching correct autotel patterns
- Auditing an existing codebase

## Anti-Patterns

### 1. Async Init / await import()

**Bad:**

```typescript
async function setup() {
  const { init } = await import('autotel');
  init({ service: 'my-api' });
}
await setup();
```

**Good:**

```typescript
import { init } from 'autotel';
init({ service: 'my-api' });
```

**Why:** `init()` must be synchronous. `await import()` delays SDK registration, causing spans to be lost before init completes. Use static imports or `safeRequire`/`requireModule` for optional dependencies.

---

### 2. Manual Span Lifecycle

**Bad:**

```typescript
import { trace } from '@opentelemetry/api';

const tracer = trace.getTracer('my-service');

export async function getUser(id: string) {
  return tracer.startActiveSpan('getUser', async (span) => {
    try {
      span.setAttribute('user.id', id);
      const user = await db.users.findById(id);
      span.setStatus({ code: SpanStatusCode.OK });
      return user;
    } catch (error) {
      span.recordException(error);
      span.setStatus({ code: SpanStatusCode.ERROR });
      throw error;
    } finally {
      span.end();
    }
  });
}
```

**Good:**

```typescript
import { trace } from 'autotel';

export const getUser = trace((ctx) => async (id: string) => {
  ctx.setAttribute('user.id', id);
  return await db.users.findById(id);
});
```

**Why:** `trace()` handles the entire span lifecycle automatically. Start, end, error recording, and status. Manual lifecycle is verbose and error-prone (forgetting `span.end()`, incorrect error handling). Use `trace()`, `span()`, or `instrument()` instead.

---

### 3. Scattered console.log

**Bad:**

```typescript
export async function handleCheckout(req, res) {
  console.log('Checkout started');
  const user = await getAuth(req);
  console.log('User:', user.id);
  const cart = await getCart(user.id);
  console.log('Cart items:', cart.items.length);
  const result = await processCheckout(cart);
  console.log('Order:', result.id);
  return res.json(result);
}
```

**Good:**

```typescript
import { trace, getRequestLogger } from 'autotel';

export const handleCheckout = trace((ctx) => async (req, res) => {
  const log = getRequestLogger(ctx);
  const user = await getAuth(req);
  log.set({ user: { id: user.id } });

  const cart = await getCart(user.id);
  log.set({ cart: { items: cart.items.length } });

  const result = await processCheckout(cart);
  log.set({ order: { id: result.id } });
  log.emitNow();
  return res.json(result);
});
```

From jagreehal/autotel, Apache-2.0.

More from jagreehal/autotel

Signals

Stars
8
Forks
3
Open issues
0
Last commit (this folder)
Jul 26, 2026 (3 months ago)
Last release
Sep 27, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jagreehal

Cite this page

autotel-anti-patterns skill. Agent Mart. https://agentmart.dev/skills/jagreehal-autotel-anti-patterns (last updated 2026-10-24)