Skip to content

Commit 926a4bb

Browse files
committed
pull in changes from upstream pr mleinart#3
1 parent f7c5455 commit 926a4bb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

haproxy.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def read_callback():
158158
return
159159

160160
for key,value in info.items():
161-
key_prefix = None
161+
key_prefix = ''
162162
key_root = key
163163
if not value in METRIC_TYPES:
164164
try:
@@ -169,12 +169,9 @@ def read_callback():
169169
continue
170170

171171
key_root, val_type = METRIC_TYPES[key_root]
172-
if key_prefix:
173-
key_name = METRIC_DELIM.join([key_prefix, key_root])
174-
else:
175-
key_name = key_root
176172
val = collectd.Values(plugin=NAME, type=val_type)
177-
val.type_instance = key_name
173+
val.plugin_instance = key_prefix
174+
val.type_instance = key_root
178175
val.values = [ value ]
179176
val.dispatch()
180177

@@ -190,4 +187,4 @@ def logger(t, msg):
190187
collectd.notice('%s: %s' % (NAME, msg))
191188

192189
collectd.register_config(configure_callback)
193-
collectd.register_read(read_callback)
190+
collectd.register_read(read_callback)

0 commit comments

Comments
 (0)