21 lines
586 B
Python
21 lines
586 B
Python
"""Abstract observability connector (Grafana / Prometheus / Datadog / ...)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from typing import Protocol, Optional, Any
|
|
|
|
|
|
class ObservabilityConnector(Protocol):
|
|
async def query_metric(
|
|
self,
|
|
query: str,
|
|
start: datetime,
|
|
end: datetime,
|
|
step: Optional[str] = None,
|
|
) -> list[dict[str, Any]]: ...
|
|
|
|
async def get_incident(self, incident_id: str) -> Optional[dict[str, Any]]: ...
|
|
|
|
async def list_active_incidents(self, limit: int = 50) -> list[dict[str, Any]]: ...
|