librato / statsd-librato-backend

A StatsD backend that sends metrics to Librato Metrics
MIT License
76 stars 34 forks source link

Handle the sourceRegex set as a string instead of a regular exp. #32

Closed mheffner closed 10 years ago

mheffner commented 10 years ago

It's possible that certain CM environments won't preserve the regex setting and set all config fields as string values. Be smart and fall back to converting from string to RegExp. It gets a bit messy because RegExp() will automatically add the //'s to enclose the string, so we strip them off if we see them set at the beginning and end of the string.