Chapter 11 – Instrumenting Messaging Scenarios
- The most difficult part is finding operations that are important to measure. In our example, it’s the time between when the meme is uploaded and when it became available for other users.
We can emit a couple of events to capture these two timestamps along with the meme identifier and any other context. Then, we can find the delta by joining events on the meme identifier.
Another option is to record the timestamp of when the meme was published along with the meme metadata and pass it around our system. Then, we can report delta as a metric or an event.
- When using batching, it’s usually interesting to know the number of messages in a batch and the payload size. By tuning these numbers, we can reduce network overhead, so having them readily available in the telemetry can be very useful.
The key question is what instrument to use: a counter or histogram (a gauge would not fit here).
We...