One custom flow, full control?
Write spans yourself when the flow is small and you own the maintenance.
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. 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 | Varies1 | No | Varies2 |
| Transaction lifecycle (send → confirm) | Yes | Varies3 | No | Varies4 | No |
| Real fee, incl. the L1 data fee | Yes | Varies3 | No | Varies4 | No |
| Decoded revert reasons | Yes5 | Varies3 | No | Varies4 | No |
| Replaced transactions handled | Yes | Varies3 | No | Varies4 | No |
| Agent identity on transaction spans | Yes | Varies3 | No | No | No2 |
| Uses your existing backend (no new dashboard) | Yes | Yes | Yes | No | Varies6 |
| Open source | Yes | Yes | Varies4 | Varies4 | Varies4 |
| Alerting and contract monitoring | No7 | No | No | Yes | No |
| LLM prompt and eval tracing | No7 | Varies3 | No | No | Yes |
Write spans yourself when the flow is small and you own the maintenance.
Latency and errors of individual JSON-RPC calls.
Alerts, security and simulation around contracts and addresses.
Prompts, tool calls, evals and token cost.
The chain outcome inside the agent's own trace, in your existing backend.
@pimlico/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.
// 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);traceTransport() records them too; with both, every request is recorded twice.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.A typical setup keeps each tool on its own job, joined by the trace and the transaction hash.
Spotted something inaccurate? Open a discussion.