diff --git a/tor-daemon/tor-daemon.py b/tor-daemon/tor-daemon.py
--- a/tor-daemon/tor-daemon.py
+++ b/tor-daemon/tor-daemon.py
#
@@ -116,6 +116,12 @@ def build_lp(measurement_name, state):
#
v = fname + "=" + str(counter[1][nm]) + "i"
#
+ # Append any tags that have been pushed into the main state object
#
+ for tag in state["tags"]:
#
+ v = tag[0] + "=" + tag[1]
#
return " ".join([l, f])
#
@@ -125,7 +131,8 @@ state = {
#
"conn_status" : "failed",
#
+ "tags" : [] # used to track failures etc
#
# Initialise a connection
#
@@ -135,6 +142,7 @@ try:
#
state["stats_failures"] += 1
#
+ state["tags"].append(["failure_type", "connection"])
#
print(build_lp(MEASUREMENT, state))
#
@@ -145,6 +153,7 @@ res = send_and_respond(s, cmd)
#
if len(res) < 1 or res[0] != "250 OK":
#
state["stats_failures"] += 1
#
+ state["tags"].append(["failure_type", "authentication"])
#
print(build_lp(MEASUREMENT, state))