We’re excited to introduce derived columns! Derived columns let you run queries based on the value of an expression that’s computed from the columns in an event, making it easier to answer questions such as:
- What does service performance look like from the perspective of our ten highest-value customers?
- How many requests spent more than 50% of their request time talking to a database?
- What fraction of service requests complete in less than 100 milliseconds?
- How did performance compare between builds older than build ID 4300, and all newer builds?
Let’s look at an example. Say you have events from a user-facing web service, and you wonder “how many requests completed in less than 100 milliseconds, and how many requests took longer than that?”
Previously, you could have added the filter request_time_ms < 100
and eyeballed the count of fast requests. Derived columns now let you directly express this breakdown using a simple function syntax. In this case, you can use the expression
LTE($request_time_ms, 100)
which evaluates to true
if the value of the request_time_ms
column is less than 100, and false
otherwise. You can create a derived column from the ‘Break Down’ clause in the query builder:
It’s also easy to further refine this query: for example, to compare the count of fast vs slow requests only for a specific customer, or for a specific build number, etc.
More Structure For Your Data
Conceptually, derived columns let you associate extra metadata to events, without needing to change the structure of the raw event. For example, let’s say you want to know “which requests spent most of their request time talking to the database?” But your events only contain absolute timings, e.g.:
{ ... "request_time_ms": 36.4, "db_query_time_ms": 7.1 ... }
Well, you could compute a db_query_time_fraction
field, and add it to your events before sending them off to Honeycomb. But that’s not always practical. Instead, you can use the derived column DIV($db_query_time_ms, $request_time_ms)
to get answers in a matter of seconds:
In later posts, we’ll explore more applications for derived columns. In the meantime, take a look at the complete documentation and give it a try!