docs: function (host, port, prefix, suffix, globalize, cacheDns, mock,
      globalTags, maxBufferSize, bufferFlushInterval, telegraf, sampleRate, protocol) {
    let options = host || {};
    const self = this;
  
    // Adding options below is DEPRECATED.  Use the options object instead.
    if (arguments.length > 1 || typeof(host) === 'string') {
      options = {
        host        : host,
        port        : port,
        prefix      : prefix,
        suffix      : suffix,
        globalize   : globalize,
        cacheDns    : cacheDns,
        mock        : mock === true,
        globalTags  : globalTags,
        maxBufferSize : maxBufferSize,
        bufferFlushInterval: bufferFlushInterval,
        telegraf    : telegraf,
        sampleRate  : sampleRate,
        protocol    : protocol
      };
    }
  
    const createSocket = function createSocket(instance, args) {
      let socket;
      let errMessage;
  
      if (args.protocol === 'tcp') {
        try {
          socket = net.connect(args.port, args.host);
          socket.setKeepAlive(true);
        } catch (e) {
          errMessage = `Could not establish connection to ${args.host}:${args.port}`;
          if (instance.errorHandler) {
            instance.errorHandler(new Error(errMessage));
          } else {
            console.log(errMessage);
          }
        }
      } else {
        socket = dgram.createSocket('udp4');
      }
  
      return socket;
    };
  
    // hidden global_tags option for backwards compatibility
    options.globalTags = options.globalTags || options.global_tags;
  
    this.protocol    = (options.protocol && options.protocol.toLowerCase());
    this.host        = options.host || process.env.DD_AGENT_HOST || 'localhost';
    this.port        = options.port || parseInt(process.env.DD_DOGSTATSD_PORT, 10) || 8125;
    this.prefix      = options.prefix || '';
    this.suffix      = options.suffix || '';
    this.socket      = options.isChild ? options.socket : createSocket(this, {
      host: this.host,
      port: this.port,
      protocol: this.protocol
    });
    this.mock        = options.mock;
    this.globalTags  = typeof options.globalTags === 'object' ?
        helpers.formatTags(options.globalTags, options.telegraf) : [];
    if (process.env.DD_ENTITY_ID) {
      this.globalTags = this.globalTags.filter((item) => {
        return item.indexOf('dd.internal.entity_id:') !== 0;
     });
      this.globalTags.push('dd.internal.entity_id:'.concat(helpers.sanitizeTags(process.env.DD_ENTITY_ID)));
    }
    this.telegraf    = options.telegraf || false;
    this.maxBufferSize = options.maxBufferSize || 0;
    this.sampleRate  = options.sampleRate || 1;
    this.bufferFlushInterval = options.bufferFlushInterval || 1000;
    this.bufferHolder = options.isChild ? options.bufferHolder : { buffer: '' };
    this.errorHandler = options.errorHandler;
  
    // If we're mocking the client, create a buffer to record the outgoing calls.
    if (this.mock) {
      this.mockBuffer = [];
    }
  
    // We only want a single flush event per parent and all its child clients
    if (!options.isChild && this.maxBufferSize > 0) {
      this.intervalHandle = setInterval(this.onBufferFlushInterval.bind(this), this.bufferFlushInterval);
    }
  
    if (options.isChild) {
      if (options.dnsError) {
        this.dnsError = options.dnsError;
      }
    } else if (options.cacheDns === true) {
      dns.lookup(options.host, (err, address) => {
        if (err === null) {
          self.host = address;
        } else {
          self.dnsError = err;
        }
      });
    }
  
    if (!options.isChild && options.errorHandler) {
      this.socket.on('error', options.errorHandler);
    }
  
    if (options.globalize) {
      global.statsd = this;
    }
  
    if (options.useDefaultRoute) {
      const defaultRoute = helpers.getDefaultRoute();
      if (defaultRoute) {
        console.log(`Got ${defaultRoute} for the system's default route`);
        this.host = defaultRoute;
      }
    }
  
    this.messagesInFlight = 0;
    this.CHECKS = {
      OK: 0,
      WARNING: 1,
      CRITICAL: 2,
      UNKNOWN: 3,
    };
  }