---
title: "coding.sh collector · coding.sh docs"
description: "Start a local OTLP/HTTP receiver for agents that export traces. Every option of coding.sh collector and its subcommands, from its own --help."
canonical: https://coding.sh/docs/cli/collector
human_url: https://coding.sh/docs/cli/collector
markdown_url: https://coding.sh/docs/cli/collector.md
agents_url: https://coding.sh/agents.md
llms_url: https://coding.sh/llms.txt
updated: 2026-11-11
---

# coding.sh collector

Start a local OTLP/HTTP receiver for agents that export traces. Every option of coding.sh collector and its subcommands, from its own --help.

Alias: `otel`.

coding.sh collector --help

```
coding.sh collector [action] [options]

  Start a local OTLP/HTTP receiver for agents that export traces

Commands
  import        Import agent traces from a ClickHouse otel_traces table (OpenTelemetry Collector clickhouseexporter)

Options
  -p, --port <PORT>  Port to listen on (0 = any free port) (default: 4318)
      --host <HOST>  Interface to bind (default: 127.0.0.1)
      --keep-raw     Also keep each source span and log record as a blob on its event (off by default: one blob write per span)

Examples
  coding.sh collector
  coding.sh otel --port 0
  coding.sh collector import --clickhouse http://127.0.0.1:8123/?database=otel

Notes
  Prints the OTEL_* environment to stdout; status goes to stderr.
  import keeps its place per table and row filter (--all, each --where) and starts the next run an hour before it (a root span lands after its children); --from-start or a --since on the command line reads from --since again. A span stored once is never stored again.
  import tries a dropped connection or a 502, 503 or 504 three more times. A run that still fails keeps the pages it read, with their sessions, and prints the command that reads the rest.

Aliases
  otel
```

## `coding.sh collector import`

Import agent traces from a ClickHouse otel_traces table (OpenTelemetry Collector clickhouseexporter).

coding.sh collector import --help

```
coding.sh collector import [options]

  Import agent traces from a ClickHouse otel_traces table (OpenTelemetry Collector clickhouseexporter)

Options
  --clickhouse <URL>  ClickHouse HTTP URL, e.g. http://127.0.0.1:8123/?database=otel (user and password from the URL or CLICKHOUSE_USER / CLICKHOUSE_PASSWORD)
  --table <TABLE>     Table to read (db.table also names the database) (default: otel_traces)
  --since <WHEN>      Only spans that started after this: a duration (7d, 12h) or a date. When given, the run reads from there again instead of resuming (default: 7d)
  --from-start        Read from --since again instead of resuming after the last span imported (nothing is stored twice)
  --where <SQL>       Extra ClickHouse condition on the rows, e.g. "ServiceName = 'claude-code'"
  --all               Read every span, not only traces with an agent span (gen_ai.*, OpenInference, Vercel AI SDK, Claude Code, eve)
  --dry-run           Show the exact changes without writing anything

Examples
  coding.sh collector import --clickhouse http://127.0.0.1:8123/?database=otel
  coding.sh collector import --clickhouse https://ch.example.com:8443/ --table otel.otel_traces --since 30d --dry-run
  coding.sh collector import --clickhouse http://127.0.0.1:8123/?database=otel --from-start
```

[All commands](https://coding.sh/docs/cli) · [Global options](https://coding.sh/docs/cli#global)

To set coding.sh up for a user, follow the agent workflow at [/agents.md](https://coding.sh/agents.md).
