Page MenuHomePhabricator

xLab: Allow users to toggle user agent collection by an instrument
Closed, DuplicatePublic

Description

Background

From Kosta's notes on creating an instrument in xLab:

One more observation: the code version of this Configure instrument for CheckUser - UserInfoCard (operations/mediawiki-config~1159626) has a snippet to disable user-agent collection, but I don't see a way to do that via MPIC. If it's not possible to set this in MPIC, then I think we do need to go with the old way of doing things for now.

TODO

  • This will need input from Design
  • We will need to think about what happens if the user selects a base stream that has user agent collection disabled but the instrument owner wants to enable it
    • We must also consider if we want to support this

AC

  • When the user clicks "Enable user agent collection" (TBD), then the user agent is available as a dimension for data analysis

Event Timeline

Milimetric triaged this task as Medium priority.Jul 17 2025, 3:18 PM
Milimetric moved this task from Incoming to READY TO GROOM on the Test Kitchen board.
Milimetric added subscribers: Sfaci, Milimetric.

@Sfaci does this fit with your attribute selection / risk level hypothesis?

@Sfaci does this fit with your attribute selection / risk level hypothesis?

Good catch! I think it does. Thanks for point it out

Thanks to Andrew I have found we also have T385180: Implement agent.ua_string as contextual attribute. As far as I understand, that one seems to be what we want to implement here. Both tasks aim to allow users to decide, at the instrument level, when UA data will be collected and that one seems to propose an approach that seems doable. Regarding ACs of this ticket:

This will need input from Design

  • We wouldn't need input from Design because we could use what we have already for the existing contextual attributes. UA data would be just a field that users can decide to collect or not

We will need to think about what happens if the user selects a base stream that has user agent collection disabled but the instrument owner wants to enable it

  • According to T385180: Implement agent.ua_string as contextual attribute it seems that decoupling UA collection from the stream config: When we start managing contextual attributes via xLab rather than stream configs, it will be easy to turn UA collection on/off, without it being strongly coupled to the stream config

And that implementation would make easier to include UA data, as a contextual attribute, to the validation rules (T401390: xLab: New validation rules for selected contextual attributes and risk level when registering/modifying an instrument) we want to implement to provide some guidance to the users regarding the data they are going to collect and the corresponding risk level.

What do you think about merging both tickets and work on the contextual attribute as a way to implement it? Am I missing something?

What do you think about merging both tickets and work on the contextual attribute as a way to implement it? Am I missing something?

YES!