Closed Bug 1879247 Opened 1 year ago Closed 1 year ago

Expose API that retrieves all Glean experiments to tests

Categories

(Toolkit :: Telemetry, enhancement)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: nalexander, Unassigned)

References

Details

While working on Bug 1868676, I realized that the existing testGetExperiment test API isn't sufficiently powerful the tests I wish to write.

In particular:

  • it doesn't expose inactive experiments;
  • it doesn't enumerate all known experiments, so that I can verify that no extra experiments have been set.

Can we arrange to return a JS object with the full set of experiments, perhaps labelled in some manner ({ active: { ... }, inactive: { ... } }), so that I can see all the data that Glean knows about?

Unfortunately, I'm not sure Glean has the information to feed such an API. Glean doesn't track inactive experiments, it only tracks those that are currently set by Nimbus on initialization and it doesn't persist this information between runs. The setExperimentInactive API only removes entries from the active experiment list tracked by Glean, there isn't any instrumentation built into this as that's not the purpose this data has so far served.

In order to support this request, it would require that the Glean SDK track information that it currently doesn't track, and then you won't have any historical access or support for this in previous versions because the data simply wouldn't exist yet.

The component that does track historical, active/inactive, non matching experiments (due to targeting, audience, etc.), is Nimbus. I wonder if your needs for this wouldn't better be served by them?

Huh -- I thought ping_info.experiments included inactive experiments. It would still be nice to enumerate the entire list of active experiments, but I don't see making Glean provide historical data (as Nimbus does).

My use case gets the data from Nimbus (as part of targeting snapshotting), and then exposes it to background tasks and also records it in Glean. I have tests for the exposure to background tasks that are quite comprehensive, but I can't really verify all of the things that I record into Glean with the current API, hence the request.

But I think what I have now is sufficient; you can close this as WONTFIX if you like to keep fewer tickets open.

Thanks Nick, if it turns out you need something more in this area, please do reopen this

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.