Goal: decide how Verex answers “which step is slow?” — and instrument in a way that does not marry us to whichever vendor we pick this year.
Source: conversation 2026-08-17 KST (Datadog / OpenTelemetry walkthrough); no external doc. Prompted by the Datadog agent question — what an agent actually collects, and where traces come from.
Metrics say “it’s slow”, traces say “this step is slow”, logs say “here’s why” — and only the first comes free from an agent. Traces are generated by a library running inside the process, so the instrumentation choice is a code decision, not an infra one. Instrument with OpenTelemetry (a protocol, not a product) and the export target becomes one config line.
| Verex track | What it needs | Note |
|---|---|---|
| ChainJob worker (api) | Distributed trace: enqueue → build tx → submit → confirm | The one place metrics structurally cannot answer the question. Highest value, do first |
| api-indexer.md (S4–S5) | Request traces + span from API → indexer | Do together with the worker — same trace context or the picture breaks at the boundary |
| mm-agent.md (S2.5 → S6) | Quote/decision latency | Second candidate; only once the worker path proves the setup |
| web-ui.md (S3) | RUM (browser) | Lowest priority — defer until there are real users |
| GCP infra | Export target | Cloud Run has no host for a normal agent: sidecar, serverless-init, or direct OTLP export |
Never tag a metric with an unbounded value. In Verex the tempting ones are exactly the dangerous
ones: market_id, user_id, tx_hash, order_id. Each distinct tag combination bills as a
separate custom metric, so one line of code becomes a five-figure invoice. Those belong on
spans and logs (where high cardinality is the point), never on metrics. Writing this down
before anyone adds the first one is cheaper than finding it on a bill.
(you) Decide the export target for now — Cloud Trace (already present, effectively
free at this size) vs Datadog (better product, real cost). The point of OTel is that this
is reversible, so pick the cheap one and move on(you) Decide SDK-direct export vs running a Collector — direct is fewer parts;
a Collector buys sampling, redaction and multi-export. Probably direct until it hurtsserverless-init / direct OTLP) and note
the cold-start cost of whichever wins