Request Id as OTel log attribute

The app I am working with currently uses Rails.logger.tagged and Rails.logger.warn. This magically includes a request id tag in the log, (along with an X-Request-Id header on the response.) As I understand it, this comes from the ActionDispatch::RequestId middleware.

Now I am switching to the OTel Ruby SDK for logging. How can I get ahold of this request id to add it as an attribute in the log?

Copilot is suggesting to add a new middleware to stuff it into RequestStore (which we are already using) from which I can grab it later. Does this seem like a reasonable idea?