Ergonomics
Before I stated that we shouldn't treat each function as its own unit of workâit's way
too verbose and it leads to a lot of noise in the logs.
Nonetheless, it is often the case that a unit of work maps to a certain function. The work
starts when that function is invoked and ends when it returns. That was indeed the case in the
previous exercise.
When it happens, we can use the instrument
macro
to avoid having to manually create a span inside the function body.
Exercise
The exercise for this section is located in 01_structured_logging/06_instrument_macro