statsd icon indicating copy to clipboard operation
statsd copied to clipboard

How to escape commas, colons, and equals in tag names and values?

Open mcandre opened this issue 8 years ago • 0 comments

How should statsd users escape tag elements that contain characters used for tag syntax?

Common strings that users may wish to include in tag names and/or values:

  • localhost:80 (network address colon conflicts with InfluxDB and Datadog formats)
  • 192.168.1.2,192.168.1.3,192.168.1.4 (comma conflicts with comma tag separator)
  • YQ== (base64 trailing equals conflicts with InfluxDB format)
  • #general (IRC channel name sharp conflicts with Datadog format)
  • cat README.txt | less (pipe in command conflicts with statsd base format)

How should these characters be escaped? Should statsd users try to use the C escape convention, like localhost\:80 and YQ\=\=?

Could alexcesaro/statsd provide standard functions for escaping and unescaping strings that contain these special characters?

Could the statsd Go API automatically escape tag names and values on the user's behalf?

mcandre avatar Mar 29 '17 19:03 mcandre