Skip to content

Commit

Permalink
feat: Add vector monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Mar 18, 2024
1 parent 83dc67e commit 4d45504
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,16 @@ def get_vector_stats(self):
metrics = r.json()["data"]["sinks"]["edges"][0]["node"]["metrics"]

# These will be null until events start arriving
received = metrics.get("receivedEventsTotal", {}).get("receivedEventsTotal", 0)
sent = metrics.get("sentEventsTotal", {}).get("sentEventsTotal", 0)
received = metrics["receivedEventsTotal"]["receivedEventsTotal"] if metrics["receivedEventsTotal"] else 0
sent = metrics["sentEventsTotal"]["sentEventsTotal"] if metrics["sentEventsTotal"] else 0

rtn = {
"events_received": received,
"events_sent": sent,
"lag": received - sent
}

log.info(f"Vector lag: {rtn.get('lag')}")
log.info(f"Vector received: {rtn['events_received']} sent: {rtn['events_sent']} lag: {rtn.get('lag')}")
return rtn


Expand Down

0 comments on commit 4d45504

Please sign in to comment.