Skip to content

Commit

Permalink
Merge pull request #35 from signalfx/SWAT-3991
Browse files Browse the repository at this point in the history
check for unexpected values due to changed json output
  • Loading branch information
dloucasfx authored Nov 23, 2021
2 parents 509acf3 + 1f19bd3 commit f364a54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def __init__(self):
self.ssl_client_key_passphrase = None

def submit(self, type, type_instance, value, db=None, extra_dims=None):
if isinstance(value, list) or isinstance(value, dict):
self.log('ERROR: unsupported value type for metric %s with value %s' % (type_instance, value))
return

v = collectd.Values()
v.plugin = self.plugin_name

Expand Down Expand Up @@ -178,7 +182,8 @@ def do_server_status(self):
# operations
if 'opcounters' in server_status:
for k, v in list(server_status['opcounters'].items()):
self.submit('counter', 'opcounters.' + k, v)
if k != "deprecated":
self.submit('counter', 'opcounters.' + k, v)

# memory
if 'mem' in server_status:
Expand Down

0 comments on commit f364a54

Please sign in to comment.