Skip to content

Commit 19bbd84

Browse files
committed
Add metric to measure failures per fastpath instance
1 parent 748eb70 commit 19bbd84

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

ooniapi/services/ooniprobe/src/ooniprobe/metrics.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ class Metrics:
9191
labelnames=["status", "instance"],
9292
)
9393

94+
FASTPATH_INSTANCE_FAILURE = Counter(
95+
"fastpath_instance_failure",
96+
"How many times a measurement submission per fastpath instance failed",
97+
labelnames = ["instance"]
98+
)
99+
94100
SEND_S3_CNT = Counter(
95101
"measurement_s3_upload_count",
96102
"How many times ooniprobe sent a measurement to s3 disaggregated by status"

ooniapi/services/ooniprobe/src/ooniprobe/routers/reports.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,14 @@ async def receive_measurement(
194194
break
195195

196196
except Exception as e:
197+
Metrics.FASTPATH_INSTANCE_FAILURE.labels(
198+
instance=fastpath_url
199+
).inc()
197200
log.exception(
198201
f"[{i + 1} / {len(fastpath_urls)}] Unable to send measurement to fastpath "
199202
f"({fastpath_url}): {e}"
200203
)
201204

202-
203205
if success:
204206
# Geoip anomaly detection runs only when the measurement was successfully
205207
# submitted to the fastpath, so retries don't cause duplicate anomaly entries.

0 commit comments

Comments
 (0)