eliot icon indicating copy to clipboard operation
eliot copied to clipboard

More selective process annotation

Open itamarst opened this issue 8 years ago • 2 comments

Right now it's possible to add a field to all messages, typically used to indicate per-process information:

eliot.add_global_fields(pid=os.getpid())

This is far too verbose in many cases, since redundant information is added to all messages.

A better alternative would be to add these fields only to start messages of actions and to cross-process tasks when they are first started, i.e. eliot:remote_task. That way the information is added in a context that indicates that it applies to all child messages, removing the need for redundancy.

Proposed new API:

eliot.add_global_fields(pid=os.getpid()) # backwards compat
eliot.add_global_fields(eliot.GLOBAL_ALL, pid=os.getpid()) # new way to specify current policy
eliot.add_global_fields(eliot.GLOBAL_START, pid=os.getpid()) # only task start and `eliot:remote_task` messages

itamarst avatar Sep 29 '15 13:09 itamarst

It isn't entirely clear to me that this is too verbose, at least absent tool support for re-interpolating the fields from those messages that don't have them.

tomprince avatar Sep 29 '15 18:09 tomprince

My thought is it doesn't need to be on all messages. If you're not sure which machine a specific message is from, either look at the full tree or query for more metadata from e.g. journald.

itamarst avatar Sep 29 '15 19:09 itamarst