What would be the best implementation to gather information about the level environment ?

On an input from the server I need to send a bunch of data from the level environment. This will be use for a neural network on the server side to calculate the next action.
The thing as I explain is that I want the flexibility to tell which component needs to send the data.
On the action I need to collect the data and send the data or send the data already collected.