More
This commit is contained in:
parent
128b3191e7
commit
03445188ea
54 changed files with 596953 additions and 3577 deletions
59
finder/metrics.py
Normal file
59
finder/metrics.py
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
from prometheus_client import Counter, Gauge
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Gauges — current scrape state, updated after each outcode
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
scrape_state = Gauge(
|
||||
"scrape_state",
|
||||
"Current scrape state as a labeled gauge (1 = active)",
|
||||
["state"],
|
||||
)
|
||||
|
||||
scrape_outcodes_done = Gauge(
|
||||
"scrape_outcodes_done",
|
||||
"Outcodes processed in current channel",
|
||||
)
|
||||
|
||||
scrape_outcodes_total = Gauge(
|
||||
"scrape_outcodes_total",
|
||||
"Total outcodes in current channel",
|
||||
)
|
||||
|
||||
scrape_properties_total = Gauge(
|
||||
"scrape_properties_total",
|
||||
"Properties found so far",
|
||||
["channel"],
|
||||
)
|
||||
|
||||
scrape_elapsed_seconds = Gauge(
|
||||
"scrape_elapsed_seconds",
|
||||
"Seconds since scrape started",
|
||||
)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Counters — monotonically increasing
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
http_requests_total = Counter(
|
||||
"http_requests_total",
|
||||
"HTTP requests made by the scraper",
|
||||
["status", "endpoint"],
|
||||
)
|
||||
|
||||
http_errors_total = Counter(
|
||||
"http_errors_total",
|
||||
"HTTP connection/timeout errors",
|
||||
["type"],
|
||||
)
|
||||
|
||||
ip_rotations_total = Counter(
|
||||
"ip_rotations_total",
|
||||
"VPN IP rotation attempts",
|
||||
["result"],
|
||||
)
|
||||
|
||||
scrape_errors_total = Counter(
|
||||
"scrape_errors_total",
|
||||
"Per-outcode scrape errors",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue