This came up in a code review during change 824717. Right now we have the following log channels:
- DBConnection
- DBPerformance
- DBReplication
- DBQuery
DBTransaction
To my knowledge there is no other component, core or extension, that uses more than one or two channels at most. This makes dashboarding in Logstash and monitoring in Prometheus/Grafana harder, and as such we have the following side effects that try to track these:
- Logstash configuration to export metrics to Prometheus, hardcoding MW details. puppet: es_exporter/15-mediawiki-mysql.
- The $wgDBerrorLog feature in MW, hardcoding each channel name (actually missing some). mediawiki: LegacyLogger
- wmf-config setting up each channel (see also T228838).
- Rdbms internally abstracting constructor logic to reduce repetition. rdbms: LBFactory rdbms: LBFactory (2)
I propose to consolidate and rename these into a single rdbms channel. I propose this consolidation includes the DBPerformance channel as well. While that channel, unlike the others, does have a different audience (i.e. not just maintainers of this code, but downstream users of it), it is generally not consumed via its channel name but by virtue of having exception.trace set which matches across all channels, thus teams discover these along with warnings and deprecations from other core components that they interact with. Those Logstash queries in the per-team dashboards will continue to work as such.