{
  "id": 12618017,
  "title": "OpenTelemetry-Style Spans for VIN Decode Latency and Upstream Attribution",
  "url": "https://urgent.news/2026/10/07/opentelemetry-style-spans-for-vin-decode-latency-and-upstream",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-07T11:45:32.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/vin_lookup_8dbd4710f77e9e/opentelemetry-style-spans-for-vin-decode-latency-and-upstream-attribution-10eg"
  },
  "original_language": "en",
  "account": "The article outlines a method for accurately measuring the latency of VIN decode operations and attributing delays to specific stages in the process using an OpenTelemetry-style span pattern implemented in TypeScript. By wrapping fetch requests with Date.now() deltas, developers can determine how long each handler takes, but this alone does not reveal the root causes of slowness. Without child spans, dashboards may incorrectly attribute performance issues to the NHTSA service when they are actually caused by factors like a cold cache or sluggish upstream services.\n\nThe proposed span model involves a single parent span named `vin.decode` for each user-facing request. Child spans are created for various stages of the decoding process, including `vin.normalize`, `vin.cache.get/set`, `vin.upstream.vpic`, and `vin.map`. These child spans allow developers to pinpoint which stage consumes the most resources and whether the delay is attributable to the application itself or upstream components.\n\nKey attributes are added to the spans to support troubleshooting without exposing sensitive VIN data. The `vin.sha256_12` attribute provides a hashed VIN, enabling unique identification without risking privacy breaches. Functions like `decodeWithSpans` demonstrate how to instrument the decode workflow, starting new spans for normalization, cache lookups, and calls to the upstream `vpic` service. The `vin.cache.get` and `vin.cache.set` spans help identify whether cache misses contribute to slowdowns, while the `vin.upstream.vpic` span specifically tracks delays incurred during the external API call.\n\nBy employing this structured approach, teams can distinguish between product bugs and external latency issues, leading to more precise performance optimization efforts and clearer communication with support teams regarding the root causes of latency problems.",
  "summary": "A free VIN decode looks like one button click. Under the hood it is normalize, validate, cache lookup, optional proxy hop, NHTSA DecodeVinValues, field mapping, and render. When p95 climbs, \"the API is slow\" is not a diagnosis -- you need spans that show which stage burned the budget and whether the wait was yours or upstream. This post sketches a small OpenTelemetry-style span pattern in…",
  "key_points": [
    "Implement OpenTelemetry-style spans for VIN decode latency.",
    "Use child spans to pinpoint slow stages: normalization, cache, upstream VPIC, mapping.",
    "Add hashed VIN attribute for privacy-safe identification."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}