DiamondLightSource / blueapi

Apache License 2.0
3 stars 5 forks source link

Pass visit_id, scan_number and instrument as part of visit metadata #552

Open DiamondJoseph opened 1 month ago

DiamondJoseph commented 1 month ago

We require knowing the instrument, scan_number and visit_id for passing information into the central processing stream. This information may be recoverable from the attach_metadata decorator and must be preserved when handling for visit metadata is changed.

callumforrester commented 1 month ago

So you want this in the start document?

DiamondJoseph commented 1 month ago

Yes. I've made the relevant ticket in dodal since the metadata attach is there (issue 666 get) https://github.com/DiamondLightSource/dodal/issues/666

@tpoliaw needs this for forwarding to central msgbus

DiamondJoseph commented 1 month ago

Arguably we should have

{
        "name": "start",
        "doc": {
            "uid": "44ca4429-ff8c-4495-8432-058b87c7f24c",
            "scan_id": 755659,
            "data_session": "cm12345-6"
            "instrument": "i22"
        }
    }

From which we can recover everything, and instrument is the only "non-standard" key on the StartDocument. Just need to integrate with the hooks for ScanNumber and DataSession.