#80 [idea] Adding Correlation and Causation IDs
Opened by msrb. Modified

This is just a food for thought.

I think there would be benefits if we could make following 3 attributes mandatory for messages that services send via message bus. Having all 3 of them would make it easier debug what is going on and it would be actually possible to infer the logical flows that we are implementing on top of event notifications.

  • message ID - this is clear; I don't know what the specification says, but I'd assume that message ID is always automatically generated by the client - so we already have this
  • correlation ID - identifies a specific instance of a pipeline/flow; I think we already have this defined in pipeline.yaml as the id attribute (?); it could be the same as the ID of a message which started the flow
  • causation ID - ID of a message that caused this message to be produced (previous message in the logical flow), null when this is a start of a new flow;

The main problem that I see here is that the requirement to have these attributes in messages goes beyond just CI systems. Services like koji/brew/Pagure that often act as starting points for various pipelines would need to conform as well.

WDYT?


@msrb

  • Message ID is already there, it is added automatically by AMQP broker I think? Just look at any message via datagrepper

  • Correlation ID - I would use pipeline ID

  • Causation ID - yeah, currently we do not have this .... even though pipeline ID can help looking for all related messages, it is not directly creating the chain ... so this is the only one I see missing in the current spec

@mvadkert

Indeed, pipeline.id seems like it could represent the correlation ID. However, I don't see the pipeline reference in the "gate" messages for example.

Does it mean that act of gating is outside of the pipeline/not part of the same flow? (that doesn't sound right to me).

I believe it should be also in the "gate" messages :)

Seems like an RFE :rabbit:

@ralph what do you think about this proposal?

Metadata