This commit is contained in:
larssand
2026-06-30 12:46:09 +02:00
parent e781f66003
commit 86065eca59
8 changed files with 58 additions and 8 deletions

View File

@@ -46,7 +46,19 @@ class GraylogStreamSource:
raise RuntimeError("invalid_graylog_field_mapping")
def fetch(self, *, max_events: int = 5_000, range_seconds: int = 300) -> tuple[list[LogEvent], dict[str, object]]:
status = self.client.probe()
try:
status = self.client.probe()
except RuntimeError as exc:
return [], {
"status": "error",
"source": "graylog_mcp",
"events_fetched": 0,
"pages": 0,
"partial": True,
"error": f"probe_error: {exc}",
"truncated": False,
"latest_event_time": "",
}
mapping_fields = [str(value) for value in self.mapping.values() if isinstance(value, str)]
arguments: dict[str, object] = {
"query": self.query,