Skip to content

Add loki.patr.cloud endpoint for authenticated log pushing#181

Closed
rakshith-ravi wants to merge 3 commits intodevelopfrom
claude/add-loki-endpoint-Ow1kl
Closed

Add loki.patr.cloud endpoint for authenticated log pushing#181
rakshith-ravi wants to merge 3 commits intodevelopfrom
claude/add-loki-endpoint-Ow1kl

Conversation

@rakshith-ravi
Copy link
Contributor

No description provided.

Add a new loki.patr.cloud subdomain that proxies authenticated log push
requests to the upstream Loki instance. Supports both native Loki push
(/loki/api/v1/push) and OTLP (/otlp/v1/logs) endpoints.

Authentication uses HTTP Basic Auth (workspace_id:api_token) and validates
the API token has workspace access before streaming the request upstream
with the X-Scope-OrgID header for multi-tenancy.

Also adds Runner::Execute permission and updates StreamRunnerDataForWorkspace
to require it instead of Runner::View, so that runner execution and log
pushing share the same permission gate.
@rakshith-ravi rakshith-ravi force-pushed the claude/add-loki-endpoint-Ow1kl branch from 081c1d0 to d0684f5 Compare March 8, 2026 16:46
@rakshith-ravi rakshith-ravi marked this pull request as ready for review March 9, 2026 17:49
… ingestion pipeline:

- Auth now uses runner ID (not workspace ID) in Basic Auth, verifying Runner::Execute permission
- Loki push handler decodes snappy+protobuf, validates deployment ownership against the authenticated runner, and rewrites runner_id/workspace_id labels before
forwarding
- New OTLP push handler (/otlp/v1/logs) supports both JSON and protobuf with the same validation
- Redis-cached lookups for runner→workspace and deployment→runner mappings (1-week TTL) with invalidation on delete
- Extract get_permission_id into a shared cached helper in permissions/mod.rs, replacing inline SQL subqueries in all 6 registry blob/manifest handlers
- Fix Loki query URL prefix and metrics endpoint using wrong config field
@rakshith-ravi rakshith-ravi deleted the claude/add-loki-endpoint-Ow1kl branch March 10, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant