4 ms·
Nothing; what the author is calling a wide event is a structured log. > Structured Log which is pretty much the Wide Event The OP's point is that you can just
by deathanatos 3y ago
Nothing; what the author is calling a wide event is a structured log.
> Structured Log which is pretty much the Wide Event
The OP's point is that you can just capture anything that one might call a metric/span/trace in a structured log.
So, it's a bit more specific, in some senses: a "metric" is a structured log bearing some value. E.g.,
{
"@timestamp": "…",
"query_kind": "list_people_in_org",
"query_time_s": .051
}
Is a structured log. It's also a single datapoint along a timeseries. The metric might be something like "query time", with a dimension "query_kind".
ELK stacks let you visualize such structured logs into graphs with only moderate pain.
A "span" is a structured log with start/end timestamps.
A trace is just a tree of spans, built out of many structured logs. In a prior life, we'd have,
{
"span_id": "root_span_id/subspan_a/subsub_span_b",
…
}
You can pull out whole traces by doing a "span_id startswith 'root_span_id'" query in whatever your query language is. You can pull out sub-traces similarly. It works even across microservice boundaries, if you coordinate the span IDs appropriately.
I think where I depart from the OP: it takes too much space. The OP advocates sampling; I'd rather a specialized data structure for metrics that can store a data point efficiently. I.e., at least in sizeof(timestamp || f32) bytes, ideally better, and then I can just not worry about sampling. (In a sense; if you're watching a continuous value, you're always sampling. But for discrete events that you're recording, I can just record all the events. But I'll only get a number. Sometimes, that's okay. I feel like this is a bit spiritually different than the sampling the OP is discussing.)
- karmakaze 3y agoThanks. I don't know why new unpopular names are used for well-known things. Googling for "Wide Events" give millions of results for "City-wide events" etc. Probably just clickbaiting--what's a Wide Event?
- phillipcarter 3y agoSo, this is just my own view, but here's how I see it: Structured logs are ... well, logs that are structured (probably json) and machines read 'em to offer nice analysis capabilities. We've largely as an industry decided that these are great, and we should use them instead of unstructured logs if we can. But just because a log is structured it doesn't mean it has what you need to effectively debug an issue! You usually need app-specific data added as key-value pairs to that log so that you can correlate stuff like "stuff is slow on this endpoint" with "and these are the device versions and user_agent strings that correlate the most with that". And a lot of developers are used to dumping some of that data into random logs, but without making that data a part of a "wider" structured log, it can be really hard to correlate the behavior you don't like with other data that aids with debugging. Hence, a desire to call them "wide events". Anyways, I'm not particularly sold on that term either. But I do think there's some need to describe not only structured logs, but structured logs that contain all the rich info you need to debug most stuff in production with general ease.
- deathanatos 3y agoStructured logs are sensible, because you're not setting yourself up to need to write a billion little parsers down the line to attempt to parse unstructured logs, if they're even still parsable. JSON, or usually ndjson, is just simple, and widely supported. It's not the only format, nor even the best format. But it is easily produced, and better than no format at all. > But just because a log is structured it doesn't mean it has what you need to effectively debug an issue! You usually need app-specific data added as key-value pairs to that log so that you can correlate stuff like "stuff is slow on this endpoint" with "and these are the device versions and user_agent strings that correlate the most with that". Yes, you have to instrument the app. There's no getting around that. Experience will tell you what to log. > And a lot of developers are used to dumping some of that data into random logs, but without making that data a part of a "wider" structured log, it can be really hard to correlate the behavior you don't like with other data that aids with debugging. Again, experience. Log correlation is easier with what the article calls a "SpanId" or a "TraceId", some places call it a "RequestId" or a "CorrelationId", just some way to say "all longs forming a particular request" so that you can just read a request, from start to end. A simple thing … but you have to log it, or you won't have it. Agreement across services about naming it all the same thing in your log store of choice also helps, so that if you need to trace it across services, you can. This really isn't hard, but it depends IME on how well your organization is otherwise functioning. E.g., do engineers talk & plan? Can they say "X would help with Y" and then have people just go "yeah, it would. Done." or is it a long drawn out fight because technical leadership can't fathom basic stuff like what a RequestId does. > But I do think there's some need to describe not only structured logs, but structured logs that contain all the rich info you need to debug most stuff in production with general ease. I feel like you're just saying "log the data we actually need", which isn't a terribly actionable thing if you don't already know the answer. If I had to make a recommendation: outcomes & latencies of I/O. Otherwise, put something into production, & be on-call for it.
- phillipcarter 3y agoYeah, a lot of what you're saying is what OpenTelemetry tries to solve for, and does so fairly well. If I were at an organization and had the ability and time, I'd move towards tracing and correlating existing logs with those traces, then adding new stuff to spans rather than creating new logs. Tracing as the baseline + common naming conventions can go a long way.
- deathanatos 3y agoI assumed "wide event" is the internal terminology at FB, given the OP. I've never personally heard it, but it the context of the OP / metrics/logs/traces, it's a pretty self-descriptive term.
- isburmistrov 3y agoHaha, I think this term is originated by Honeycomb team actually. Why I prefer "wide event" over "structured log" as a term because it has this "wide" component that serves for 2 purposes: - it highlights the intention of storing as much context as possible - it also hints on the implementation for a system that would serve them. One likely need to use columnar storage to store wide events, there is no way around it But just a personal preference in the end.