3 ms·
Traces and spans can be extended from or added to existing logging, but they aren't the same. Logs are point in time, spans are a duration. Logs are flat, span
by BoiledCabbage 1y ago
Traces and spans can be extended from or added to existing logging, but they aren't the same.
Logs are point in time, spans are a duration. Logs are flat, spans have a hierarchy.
It's the difference between logging a message in a function, and logging the beginning and end of a function while noting the specific instance of the fn caller.
If you have many threads or callers to the same function that difference is critical in tracing causality of failures or any other type of action of note.
- zug_zug 1y agoLogs can represent point in time, or spans, or anything you choose. Logs can have the span-id attached to them (and normally should), so they are hierarchical. In short, logs can do everything spans can do, depending on how you use them. So really there isn't much distinction. I'd say that spans and logs are about 95% similar, whereas metrics are wildly dissimilar to both. Most tools would be be better if they treated spans and logs as two nearly-identical things: - logs should be viewable in a hierarchy if they have a span id associated - spans should be queryable and countable and alarmable and dashboardable with the same tools as logs