`$wgEventLoggingStreamNames` allows us to filter out configurations for streams that aren't published to by the EventLogging JavaScript client, thereby reducing bytes sent. However, it introduces friction when deploying new streams (and/or instruments) and can also drift when contributors shift focus.
However, since `$wgEventLoggingStreamNames` is a subset of the set of stream configurations, `$wgEventStreams`, it can be automatically generated given some convention. For example, let's say that if an event stream has the `event_logging_js` producer, then it is added to `$wgEventLoggingStreamNames`:
```lang=php,name=operations/mediawiki-config/wmf-config/CommonSettings.php
if ( $wmgUseEventLogging ) {
$wgEventLoggingStreamNames = array_keys( array_filter(
$wgEventStreams,
fn ( $eventStream ) =>
isset( $eventStream[ 'producers' ] ) ? isset( $eventStream[ 'producers' ][ 'event_logging_js' ] ) : false
) );
}
```
Pros:
* We still minimise bytes sent
* It Just Works™ - contributors/EventLogging maintainers no longer need to remember to update `$wgEventLoggingStreamNames`
Cons:
* The above would run for every request served by the app servers