Debugging microservice latency spikes and database bottlenecks requires tracing request lifecycles across process boundaries. Implementing **OpenTelemetry (OTel)** with the W3C `traceparent` standard allows developers to follow a single website contact form submission from edge Nginx ingress to Node.js backend to MongoDB query execution in Grafana Tempo.
1. OpenTelemetry Span Hierarchy
| Span Name | Component Layer | Captured Attributes |
|---|---|---|
http.ingress | Nginx / Express | HTTP method, route, tenant domain, client IP, response code. |
mvc.controller.resolve | NavigationService | Tenant lookup duration, cache hit/miss status. |
db.mongo.query | MongoDB Driver | Collection name, query filter, execution duration, document count. |
react.ssr.render | ReactDOMServer | Component name, HTML payload byte size, render latency. |
