Implement Monlet MVP stack and UI updates
This commit is contained in:
18
server/tests/test_metrics.py
Normal file
18
server/tests/test_metrics.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import pytest
|
||||
|
||||
from ._helpers import make_event, make_heartbeat
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_metrics_endpoint(app_client, auth_headers):
|
||||
await app_client.post("/api/v1/heartbeat", json=make_heartbeat(), headers=auth_headers)
|
||||
ev = make_event(status="critical", exit_code=2)
|
||||
await app_client.post(
|
||||
"/api/v1/events", json={"agent_id": "agent-1", "events": [ev]}, headers=auth_headers
|
||||
)
|
||||
r = await app_client.get("/metrics")
|
||||
assert r.status_code == 200
|
||||
body = r.text
|
||||
assert "monlet_server_heartbeats_total" in body
|
||||
assert "monlet_server_events_total" in body
|
||||
assert "monlet_server_incidents_opened_total" in body
|
||||
Reference in New Issue
Block a user