Differences between measurements and metadata and how to use them properly

In the huge codebase we took over there is currently basically no logging at all, and we introduced telemetry and prom_ex to the stack.

Alone the default metrics we enabled gave us a lot if insights, and now we are adding additional telemetry.span and telemetry.execute when we change certain areas, and also introduce corresponding handlers for logging and promex plugins.

This gives us more and more insights into how the application actually performs.

Though we both have a weird feeling about using it correctly.

The handlers will receive metadata and measurement data, where by our understanding the metadata can be used to further qualify an event (eg route: "/foo/bar") to distinguish the event from events that affected other routes, while the measurements are actual measurable data points, that would vary with each event of the same “type” after being further qualified via the metadata, (eg. transfered_bytes: 100).

Though if this understanding is correct, why can’t I add measurements to :telemetry.span and basically have to put the transfered bytes into the metadata?

Yeah, transferee bytes should be a measurement but you can’t add them using span. span is simple to implement though, so I suggest emulating it with your own events.

1 Like