fix(prometheus): the list page is a section top; the scrape test builds its text without format(); docs (#5668, #5670)
- tests/test_breadcrumbs.py: the Prometheus target list is its section's own top page, like SNMP's, so it carries no trail. - The integration test's exposition has label braces, which str.format read as fields: the fake scrape raised, the target was recorded down and no series landed. It substitutes the counter with replace() now. - docs/plugins/prometheus.md: adding a target, filtering, how series are named and stored, alerting, and the Fabled Archives recipe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ TEXT = """\
|
||||
# TYPE fa_backup_target_state gauge
|
||||
fa_backup_target_state{target="Steward",state="late"} 0
|
||||
# TYPE fa_requests_total counter
|
||||
fa_requests_total {count}
|
||||
fa_requests_total COUNT
|
||||
# TYPE noise gauge
|
||||
noise 1
|
||||
"""
|
||||
@@ -63,7 +63,7 @@ def test_a_scrape_records_series_rates_and_a_down_target_fires_its_rule(app):
|
||||
tokens.append(token)
|
||||
if "gone" in url:
|
||||
raise ScrapeError("Couldn't connect: connection refused.")
|
||||
return prometheus.parse(TEXT.format(count=next(counts)))
|
||||
return prometheus.parse(TEXT.replace("COUNT", str(next(counts))))
|
||||
|
||||
async def latest(name_prefix):
|
||||
async with app.db_sessionmaker() as s:
|
||||
|
||||
Reference in New Issue
Block a user