rackerlabs / otter

Rackspace Auto Scale
http://www.rackspace.com/cloud/auto-scale/
Other
53 stars 27 forks source link

transaction id header in requests to Nova/CLB #843

Open manishtomar opened 9 years ago

manishtomar commented 9 years ago

Add request id header from otter's transaction id when sending request to Nova/CLB. This allows us to correlate requests from otter to Nova.

manishtomar commented 9 years ago

Right now in worker, otter has 2 ids associated with each request:

  1. Per request ID: Every HTTP request sent from otter to Nova/CLB will have unique ID. This can be sent as otter-request-id header when talking to Nova/CLB.
  2. Per transaction ID: A transaction corresponds to HTTP request received. For example, policy execution request generates a transaction ID that gets sent to all the logs that generate from that request. These logs include creating/deleting servers/CLB nodes. This can be sent as otter-transaction-id header when talking to Nova/CLB. Scheduled policy works differently. Each schedule run has an ID that can be sent as transaction id header to HTTP request sent during scheduled policy executions in that run. Please note that there can be different tenant's different groups getting executed in same schedule run. This ID would be different in convergence. Each converge run can have ID that can correspond to this ID.

Does above changes sound reasonable?

cyli commented 9 years ago

I have no idea why I missed the second comment. Yes that sounds reasonable.

Update: we might want to prepend an "X-" to all those header names for non-standard names? I think that was deprecated (https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#cite_note-2) but the reason was that it made things difficult when non-standard became standard, but if 'otter' is in the name that is probably not a danger.

cyli commented 9 years ago

Update: the per-request ID is done. The transaction ID has not been done yet, since at least with the converger, it may not be part of a transaction, but a convergence run.