← Back to Node.js performance mapspans
Node.js Performance
Manual Spans
Add custom spans around business operations.
Detailed Description
Manual spans add business meaning that auto-instrumentation cannot know. They let you name operations like placeOrder, calculatePrice, reserveInventory, or sendInvoice.
Add attributes carefully: include IDs and categories that help debugging, but avoid secrets, large payloads, and high-cardinality values that make tracing expensive.
Mental Model
start span -> do work -> add attributes -> end span
When To Use
- ->Auto-instrumentation is too generic
- ->You need domain-specific span names
- ->You want to mark cache hits, user IDs, or job names
Tools: trace.getTracer, span attributes, error recording
manual-span.js
Live Editor
Loading...
Output
Run code to see output...
Comments
Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.
Loading comments...
All courses
24 courses in 5 subjects
AI
System Design
Backend
- GraphQL8 modules · 69 lessons planned
- Core Python13 modules · 75 lessons planned
- FastAPI5 sections · 20 lessons
- Node.js14 modules · 206 lessons planned
- Node.js Performance7 chapters · 36 topics
- Event Loop Lifecycle6 phases · 3 scenarios
- Docker & Containerization11 modules · 144 lessons planned
- AWS for Developers14 modules · 219 lessons planned
- CI/CD & DevOps Automation10 modules · 134 lessons planned
Frontend
Fundamentals
On this page
0 sections