Skip to main content
Version: 1.0

Log Gateway

This is a stateless Loki façade. It translates KubeOpera queries into LogQL, fetches log streams from Loki's query_range API, and returns normalised results. No database — all state lives in Loki.

What It Does​

  • Accepts queries by service name, namespace, and time range
  • Runs log pattern extraction using Loki's | pattern filter
  • Returns context logs (last N lines) for a given service + namespace pair

LogQL Translation​

Each endpoint builds a LogQL selector:

EndpointGenerated selector
/search?service=payments-api{app="payments-api"}
/search (no service){job="kubernetes"}
/context?namespace=prod&service=api{namespace="prod", app="api"}

REST API​

MethodPathDescription
GET/api/v1/logs/searchSearch log lines (?service=&start=&end=&limit=)
GET/api/v1/logs/patternsExtract recurring log patterns (?service=&window=1h)
GET/api/v1/logs/contextRecent lines for a service/namespace pair (?service=&namespace=)
GET/healthzHealth check

Environment Variables​

VariableDefaultDescription
LOKI_URLhttp://localhost:3100Loki endpoint
PORT8099HTTP port