in packages/core/lib/middleware/mw_utils.js [24:40]
sampler: require('./sampling/default_sampler'),
/**
* Enables dynamic naming for segments via the middleware. Use 'AWSXRay.middleware.enableDynamicNaming()'.
* @param {string} [hostPattern] - The pattern to match the host header. See the README on dynamic and fixed naming modes.
* @alias module:mw_utils.enableDynamicNaming
*/
enableDynamicNaming: function(hostPattern) {
this.dynamicNaming = true;
if (hostPattern && typeof hostPattern !== 'string') {
throw new Error('Host pattern must be a string.');
}
this.hostPattern = hostPattern || null;
},