feat(logs): widen source filter to multi-value OR list

Replaces LogSearchRequest.source (String) with sources (List<String>)
and emits 'source IN (...)' when non-empty. LogQueryController parses
?source=a,b,c the same way it parses ?level=a,b,c.
This commit is contained in:
hsiegeln
2026-04-17 11:48:10 +02:00
parent e8d6cc5b5d
commit 769752a327
4 changed files with 69 additions and 9 deletions

View File

@@ -7,15 +7,15 @@ import java.util.List;
* Immutable search criteria for querying application logs.
*
* @param q free-text search across message and stack trace
* @param levels log level filter (e.g. ["WARN","ERROR"])
* @param levels log level filter (e.g. ["WARN","ERROR"]), OR-joined
* @param application application ID filter (nullable = all apps)
* @param instanceId agent instance ID filter
* @param exchangeId Camel exchange ID filter
* @param logger logger name substring filter
* @param environment optional environment filter (e.g. "dev", "staging", "prod")
* @param source optional source filter: "app" or "agent"
* @param from inclusive start of time range (required)
* @param to inclusive end of time range (required)
* @param sources optional source filter (e.g. ["app","container","agent"]), OR-joined
* @param from inclusive start of time range
* @param to inclusive end of time range
* @param cursor ISO timestamp cursor for keyset pagination
* @param limit page size (1-500, default 100)
* @param sort sort direction: "asc" or "desc" (default "desc")
@@ -28,7 +28,7 @@ public record LogSearchRequest(
String exchangeId,
String logger,
String environment,
String source,
List<String> sources,
Instant from,
Instant to,
String cursor,
@@ -44,5 +44,6 @@ public record LogSearchRequest(
if (limit > MAX_LIMIT) limit = MAX_LIMIT;
if (sort == null || !"asc".equalsIgnoreCase(sort)) sort = "desc";
if (levels == null) levels = List.of();
if (sources == null) sources = List.of();
}
}