←back to thread

116 points ndhandala | 2 comments | | HN request time: 0.451s | source
Show context
zug_zug ◴[] No.45082843[source]
This is sort of all just a reframing of existing technologies.

Span = an event (which is bascially just a log with an associated trace), and some data fields. Trace = a log for a request with a unique Id.

A useful thing about opentelemetry is that there's auto-instrumentation so you can get this all out-of-the-box for most JVM apps. Of course you could probably log your queries instead, so it's not necessarily a game-changer but a nice-to-have.

Also the standardization is nice.

replies(3): >>45083789 #>>45083847 #>>45084887 #
jeffbee ◴[] No.45083789[source]
I always preach the isomorphism between traces and logs, but you left out the key thing. A span is a log entry associated with a trace, but the other key attributes of the span are its own unique identifier and a reference to the other event that caused the event. With those three attributes you can interpret the trace as a casual graph.
replies(1): >>45084086 #
zug_zug ◴[] No.45084086[source]
True. I think I’m emphasizing their similarities because what I’m seeing is companies treating them as unrelated (eg splunk and signalfx making entirely different query languages and visualization tools for logs vs spans)

Imo spans and logs should be understood as the same and displayed and queried the same (it’s trivial to add span id to each log), it almost feels like people are trying to make something trivially simple seem more substantial or complex

replies(1): >>45084268 #
1. BoiledCabbage ◴[] No.45084268[source]
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.

replies(1): >>45105816 #
2. zug_zug ◴[] No.45105816[source]
Logs 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