OpenTSDB / tcollector

Data collection framework for OpenTSDB
http://opentsdb.net
GNU Lesser General Public License v3.0
513 stars 359 forks source link

TCollector doesn't allow tag host=hbase:16020 due to colon not being permitted in tags regex #406

Closed HariSekhon closed 5 years ago

HariSekhon commented 6 years ago

Tags such as

host=myhost:16020

are rejected by TCollector due to the following regex in tcollector.py:

'((?:\s+[-_./a-zA-Z0-9]+=[-_./a-zA-Z0-9]+)*)$', # Tags

at line https://github.com/OpenTSDB/tcollector/blob/master/tcollector.py#L341

This means collectors I have written to collect things like TSD's own region_clients metrics which have a field called endpoint containing '/hostname:16020' pointing to the HBase server are now allowed as tags and I end up having to strip the port off.

It's a simple fix to the regex, question is - is there any reason why colons are not allowed in TCollector / OpenTSDB tags?

HariSekhon commented 6 years ago

I wonder if this is to try to avoid conflicts in queries using colon as a field delimiter?

johann8384 commented 5 years ago

the port should be a separate tag. So either replace the : with a -/_ or something, or add host=hostname and port=16020 tags