@dcreager observed to me the other day that profiling & logging are both instances of tracing. measure has something of this character; we explicitly delimit a block of some significance, which significance is currently defined entirely in terms of the measurements we may take.
But the same deliberately laid-out structure (beyond the actual call stack, which is an implementation detail) is relevant to logging (cf structured logging, observability) as well, for exactly the reason Doug pointed out: it’s a delineation in how you choose to organize your program’s execution.
This suggests decoupling this structure from the Profile effect & instead defining profiling as (approximately) a (structure-enriched) Writer of labelled measurements. Then carriers for a hypothetical logging effect could likewise take advantage of this information.
@dcreager observed to me the other day that profiling & logging are both instances of tracing.
measure
has something of this character; we explicitly delimit a block of some significance, which significance is currently defined entirely in terms of the measurements we may take.But the same deliberately laid-out structure (beyond the actual call stack, which is an implementation detail) is relevant to logging (cf structured logging, observability) as well, for exactly the reason Doug pointed out: it’s a delineation in how you choose to organize your program’s execution.
This suggests decoupling this structure from the
Profile
effect & instead defining profiling as (approximately) a (structure-enriched)Writer
of labelled measurements. Then carriers for a hypothetical logging effect could likewise take advantage of this information.