metricq-python icon indicating copy to clipboard operation
metricq-python copied to clipboard

Set user_id for sending metrics

Open tilsche opened this issue 4 years ago • 3 comments

For debugging purposes it would be helpful to be able to determine the sender of a message. This requires setting the user_id in the sender itself (see https://adam.younglogic.com/2016/03/id-sender-rabbitmq/).

We should at least check if this has a significant performance cost given our current message rates.

tilsche avatar Mar 22 '21 11:03 tilsche

aio_pika.Message supports setting a user ID; and we could parse the current user from Agent._management_url, correct?

phijor avatar Mar 22 '21 11:03 phijor

The amqp user may not be unique, the token would be better. We may eventually check that with respect to security though (as we initially intended tokens to be eventually secret).

tilsche avatar Mar 22 '21 11:03 tilsche

The user_id must be the amqp user.

data channel error: PRECONDITION_FAILED - user_id property set to 'source-stress-test' but authenticated user was 'admin'

We could instead use appID like in Db::on_history.

kinnarr avatar Jul 21 '21 14:07 kinnarr