# How hashspan compares

> Where hashspan fits next to manual OpenTelemetry spans, Pimlico's viem instrumentation, contract monitoring and LLM observability. Often used together.

Source: https://hashspan.dev/compare

hashspan records an AI agent's on-chain transactions as OpenTelemetry spans inside the agent's own trace. The same goes for a TypeScript service that sends EVM transactions through viem, the Coinbase CDP SDK or x402, or through a [wallet service](https://hashspan.dev/docs/integrations#wallet-services). Other tools do different jobs, and many teams use several together. This page compares approaches, not products.

| Capability | hashspan | Manual OTel spans | RPC-level instrumentation | Contract / address monitoring platforms | LLM / agent observability platforms |
|---|---|---|---|---|---|
| Lives inside the agent's trace | Yes | Yes | Varies (note 1) | No | Varies (note 2) |
| Transaction lifecycle (send → confirm) | Yes | Varies (note 3) | No | Varies (note 4) | No |
| Real fee, incl. the L1 data fee | Yes | Varies (note 3) | No | Varies (note 4) | No |
| Decoded revert reasons | Yes (note 5) | Varies (note 3) | No | Varies (note 4) | No |
| Replaced transactions handled | Yes | Varies (note 3) | No | Varies (note 4) | No |
| Agent identity on transaction spans | Yes | Varies (note 3) | No | No | No (note 2) |
| Uses your existing backend (no new dashboard) | Yes | Yes | Yes | No | Varies (note 6) |
| Open source | Yes | Yes | Varies (note 4) | Varies (note 4) | Varies (note 4) |
| Alerting and contract monitoring | No (note 7) | No | No | Yes | No |
| LLM prompt and eval tracing | No (note 7) | Varies (note 3) | No | No | Yes |

Notes:

1. RPC spans can nest under the active span, but they describe JSON-RPC calls, not the transaction outcome.
2. They see the agent and the tool call. The transaction outcome stays outside the trace unless you add it yourself.
3. Possible if you write and maintain the instrumentation yourself.
4. Depends on the specific tool or platform.
5. Best effort: the transaction is replayed with eth_call on the previous block, and once more on its own block when that replay does not revert. Error messages are opt-in.
6. Usually their own backend and UI; many accept OpenTelemetry (OTLP) input.
7. Not hashspan's job. Use it alongside a monitoring or LLM observability platform; your tracing backend can still alert on spans.

## When to use what

### One custom flow, full control?

Manual OTel spans: Write spans yourself when the flow is small and you own the maintenance.

### Is my node or RPC provider slow?

RPC-level instrumentation: Latency and errors of individual JSON-RPC calls.

### Did anything touch this contract?

Monitoring platforms: Alerts, security and simulation around contracts and addresses.

### Why did the agent do that?

LLM / agent observability: Prompts, tool calls, evals and token cost.

### Did the agent's transaction land, and what did it cost?

hashspan: The chain outcome inside the agent's own trace, in your existing backend.

## With Pimlico's viem instrumentation

[@pimlico/opentelemetry-instrumentation-viem](https://github.com/pimlicolabs/opentelemetry-instrumentation-viem) patches viem's JSON-RPC client and records a span for each request, with the method and the RPC server. hashspan records the transaction: was it mined, what did it cost, why did it revert. They answer different questions, and they work together.

```js
// tracing.cjs: load it before the agent, with node --require ./tracing.cjs agent.cjs
const { NodeTracerProvider, BatchSpanProcessor } = require('@opentelemetry/sdk-trace-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-proto');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { ViemInstrumentation } = require('@pimlico/opentelemetry-instrumentation-viem');

new NodeTracerProvider({ spanProcessors: [new BatchSpanProcessor(new OTLPTraceExporter())] }).register();
// A span for each JSON-RPC request made inside a trace, such as the agent's tool calls.
registerInstrumentations({ instrumentations: [new ViemInstrumentation({ requireParentSpan: true })] });

// agent.cjs: hashspan on the clients, as usual.
const hashspan = withHashspan();
const wallet = createWalletClient({ account, chain, transport: http(rpcUrl) }).extend(hashspan);
const reader = createPublicClient({ chain, transport: http(rpcUrl) }).extend(hashspan);
```

The span tree:

- `execute_tool pay_vendor` (your agent)
  - `send 31337` (hashspan)
    - `eth_fillTransaction` (Pimlico)
    - `eth_sendRawTransaction` (Pimlico)
  - `eth_getTransactionReceipt` (Pimlico)
  - `confirm 31337 · linked to send` (hashspan)
  - `eth_blockNumber, eth_getTransactionByHash, …` (Pimlico)

One run on a local chain, as Jaeger showed it: the requests that sign and send nest under hashspan's send span, because it is the active span while the send runs.

- **Pick one source of JSON-RPC spans.** hashspan's [`traceTransport()`](https://hashspan.dev/docs/adapters/viem#json-rpc-requests) records them too; with both, every request is recorded twice.
- **Mind the URL.** Pimlico's spans carry the full RPC URL (`url.full`), so a provider key in the URL ends up in your traces. `traceTransport()` records the method and the host, without the URL path, parameters or results.
- **Checked with** @hashspan/viem 0.8.2, @pimlico/opentelemetry-instrumentation-viem 0.0.5-alpha.1 and viem 2.57.2, as CommonJS, on 2026-10-02 (UTC).

## Use them together

A typical setup keeps each tool on its own job, joined by the trace and the transaction hash.

1. Agent observability: prompts, tool calls, evals
2. hashspan: send · confirm · fee · revert, in the same trace
3. Monitoring platform: alerts on contracts and addresses

Start tracing: https://hashspan.dev/docs/quickstart.md
