Parent task/goal: T398480: [Epic] Update instruments configuration for xLab
Background
Currently, we deliver the configuration for the Metrics Platform client inside of stream configuration – sampling unit and sample size, and contextual attributes are configured on a per-stream basis. Therefore, there is a one to one relatonship between streams and instruments. However, this is misaligned with the relationship that we present through xLab. In xLab, an instrument owner can create many instruments that share the same stream, i.e. one stream can have many instruments.
(Emphasis mine)
We need to update the Metrics Platform client (MetricsClient) so that it can use both instrument configs fetched from xLab and stream configs fetched from the EventStreamConfig extension.
AC
- MetricsClient#submit() still uses stream configs
- MetricsClient#newInstrument() uses instrument configs first and falls back to stream configs
- This ensures backwards compatibility with existing uses of MetricsClient#newInstrument()
- Instrument#submit() submits an event to the stream in the instrument config