fix(prometheus): a refused token stops the scraping, as Home Assistant bans an address after a few refusals (#6355)
Also names the Home Assistant connection by its address in the audit log and timeline, where its id showed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -153,6 +153,7 @@ async def save_target(target_id: str):
|
||||
# Where it is or what is kept may have changed: the last outcome no
|
||||
# longer describes it, so the page says "not scraped yet" until the next scrape.
|
||||
target.last_scraped_at = target.last_ok_at = target.last_error = None
|
||||
target.refused = False
|
||||
target.last_kept = target.last_dropped = target.last_capped = 0
|
||||
if old_name != target.name:
|
||||
# Its history is stored under its name, and its labelled series
|
||||
@@ -188,6 +189,7 @@ async def toggle_target(target_id: str):
|
||||
# Resumed: it reads "not scraped yet" until the next scrape,
|
||||
# rather than stale from before the pause.
|
||||
target.last_scraped_at = target.last_error = None
|
||||
target.refused = False
|
||||
enabled, name = target.enabled, target.name
|
||||
# A rate needs two readings in a row; one from before the pause isn't one.
|
||||
from . import scheduler
|
||||
|
||||
Reference in New Issue
Block a user