Description
In order to serve all platforms and custom schemas, we should capture the stream name in the instrument forms so that when MP instrument configs are merged via the MW extension, we have the stream name (which maps to a schema title in static config) to construct the requisite json for event ingestion.
Technical Notes
Current api endpoint returns json in the following format:
The MediaWiki MetricsPlatform extension takes above json and transforms into the right format for stream configs merging:
There are a couple of paths forward from simplest (for MVP) to most complex (required for full-fledge support of all MP based streams that use MP base schema fragments):
- Option 1 - support base instruments only (app + web)
- This would only require a radio type field that allows user to select the web base instrument or the app base instrument and MPIC can populate these properties by default (we know the stream name and schema title)
- Option 2 - support base instruments + custom instruments with a simple text field to capture stream name
- This would require the user to input a precise stream name which must be deployed to production as static config (which we could add helper text and examples in the form field description) that the instrument's stream config would validate against before event submission
- Option 3 - support base instruments + custom instruments with an autocomplete lookup field for the stream name
- This is the ideal option for fool-proofing entering valid stream names but is more complicated to do properly. Requires api call to return the possible array of production stream names (which maps to a specific schema title.
Decision
Recent discussion led to implementing Option 2 for MVP
Acceptance Criteria
- A new stream name form field is added to all the forms
- Public API endpoint includes this property
- Data store includes this field in the instrument table
- Design doc is updated
Required
- Unit/Integration tests?
- Documentation?
- Passed QA?