OpenTSDB / tcollector

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

Fix `TypeError: unhashable type` when stripping off tags exceeding max #366

Open rickatnight11 opened 7 years ago

rickatnight11 commented 7 years ago

Before:

2017-04-15 19:32:17,916 tcollector[13905] ERROR: Uncaught exception in SenderThread, going to exit
Traceback (most recent call last):
  File "/usr/local/tcollector/tcollector.py", line 522, in run
    self.send_data()
  File "/usr/local/tcollector/tcollector.py", line 691, in send_data
    return self.send_data_via_http()
  File "/usr/local/tcollector/tcollector.py", line 763, in send_data_via_http
    subset_metric_keys = frozenset(metric_tags[:len(metric_tags[:self.maxtags-len(metric_entry["tags"])])])
TypeError: unhashable type
2017-04-15 19:32:17,917 tcollector[13905] INFO: shutting down children

After:

2017-04-15 19:54:08,818 tcollector[12387] ERROR: Exceeding maximum permitted metric tags - removing set(['service']) for metric proc.net.tcp
2017-04-15 19:54:08,818 tcollector[12387] ERROR: Exceeding maximum permitted metric tags - removing set(['service']) for metric proc.net.tcp
2017-04-15 19:54:08,819 tcollector[12387] ERROR: Exceeding maximum permitted metric tags - removing set(['service']) for metric proc.net.tcp
2017-04-15 19:54:08,819 tcollector[12387] INFO: Selected connection: <omitted>:4343
vasiliyk commented 6 months ago

Rick, thank you for contributing! Could I ask you to resubmit PR against updated tcollector?

rickatnight11 commented 6 months ago

Sadly I haven't used tcollector in over 5y, so I'm not the best judge of how to implement this with the latest code (or if it's even still an issue).