docs: def setup_instrumentation(self):
          """Configure instrumentation for submission per message measurements
          to statsd and/or InfluxDB.
  
          """
          if not self.config.get('stats') and not self.config.get('statsd'):
              return
  
          if 'stats' not in self.config:
              self.config['stats'] = {}
  
          # Backwards compatible statsd config support
          if self.config.get('statsd'):
              warnings.warn('Deprecated statsd configuration detected',
                            DeprecationWarning)
              self.config['stats'].setdefault('statsd',
                                              self.config.get('statsd'))
  
          if self.config['stats'].get('statsd'):
              if self.config['stats']['statsd'].get('enabled', True):
                  self.statsd = statsd.Client(self.consumer_name,
                                              self.config['stats']['statsd'])
              LOGGER.debug('statsd measurements configured')
  
          # InfluxDB support
          if influxdb and self.config['stats'].get('influxdb'):
              if self.config['stats']['influxdb'].get('enabled', True):
                  self.influxdb = self.setup_influxdb(
                      self.config['stats']['influxdb'])
              LOGGER.debug('InfluxDB measurements configured: %r', self.influxdb)