opened
ethax-ross
username_0
### Trello card

[Trello-1412](https://trello.com/c/65tZmUeb/1412-add-correlation-ids-to-rails-apps-and-api)

### Context

We want to be able to track requests from the app right through to the API. In order to do this we need to set a correlation id header in the requests going to the API. Rails has a request id we can tap into, but getting it into the API client for all requests will be tricky/verbose.

To make life easier this commit exposes the Rails request id to the current thread, so that we can have custom Faraday middleware read the id and set a header in the API client. Whilst having thread globals isn't ideal, we are using `ActiveSupport::CurrentAttributes` to ensure that they get cleaned up after each request and I think its a relatively sensible/pragmatic use case here.

### Changes proposed in this pull request

- Expose request uuid to current thread

### Guidance to review
Expose request uuid to current thread
issue