Skip to content

Commit

Permalink
Merge 40fb74b into 7ddf154
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceaulinic committed Jun 15, 2020
2 parents 7ddf154 + 40fb74b commit a460f8f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions napalm_logs/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ def start(self):
"napalm_logs_server_messages_unknown_queued",
"Count of messages queued as unknown"
)
if self.opts.get('metrics_include_attributes', True):
napalm_logs_server_messages_attrs = Counter(
"napalm_logs_server_messages_attrs",
"Count of messages from the server process with their details",
['device_os', 'host', 'tag']
)
self._setup_ipc()
# Start suicide polling thread
cleanup = threading.Thread(target=self._cleanup_buffer)
Expand Down Expand Up @@ -305,6 +311,12 @@ def start(self):
self.pub.send_multipart([dev_os,
umsgpack.packb((msg_dict, address))])
napalm_logs_server_messages_device_queued.labels(device_os=dev_os.decode()).inc()
if self.opts.get('metrics_server_include_attributes', True):
napalm_logs_server_messages_attrs.labels(
device_os=dev_os.decode(),
host=msg_dict['host'],
tag=msg_dict['tag']
).inc()

elif dev_os and dev_os not in self.started_os_proc:
# Identified the OS, but the corresponding process does not seem to be started.
Expand Down

0 comments on commit a460f8f

Please sign in to comment.