feat: Log Streams — stream audit logs and secret events to Datadog - #961
Open
nimish-ks wants to merge 57 commits into
Open
feat: Log Streams — stream audit logs and secret events to Datadog#961nimish-ks wants to merge 57 commits into
nimish-ks wants to merge 57 commits into
Conversation
…nd service token (legacy) access (for now)
… count along with sync
…s, what to include/exclude, content length limits
Signed-off-by: Rohan Chaturvedi <rohan.chaturvedi@protonmail.com>
…parsing, expired-row auto-resolve, sargable cursor bound
…ries, drop dead job_id column, split provider choices sync
…e rotating-secrets UI
…ist, concurrent-index migration split, 202-only redirect-safe ship, retry setup traces, delete-time delivery resolution, pause on config errors, sanitized crash messages, batched retention, poll fan-out and delivery-history fixes
…g, explicit pagination limit, paused-stream lag restored, deleted-stream retention carve-out, ungated pause and stream teardown UI for downgraded orgs
rohan-chaturvedi
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 Overview
This PR adds Log Streams: continuous, near-real-time export of organisation audit logs and app secret events to external log platforms, starting with Datadog. Streams are configured under Integrations → Log Streams, ship in the background, and expose per-delivery observability with manual retry/backfill for anything that fails.
💡 Proposed Changes
LogStream+LogStreamDeliveryEventmodels: provider config, event-source selection, per-source cursors, health, and a per-chunk delivery history.log-streamsRQ queue (30s scheduler sweep). Events are serialized into a versioned, OTel-aligned envelope, chunked under the destination's payload limits, and delivered with an exponential retry ladder honouringRetry-After.@event.id. Failed chunks are recorded with their exact event range and never block newer events; auth failures pause the stream; ranges older than Datadog's 18h ingestion window are recorded as skipped, with a REST backfill path.org_audit,secretstoday), so new sources and providers slot in without schema changes.network.client.ip,http.useragent,usr.*,ddtags) so facets and Cloud SIEM rules work with no pipeline config; Datadog site regions as a dropdown in the credential form; Test connection validates the API key without writing any data.LogStreamspermission resource; managing streams requires a role with global access. Log-stream changes appear in the org audit log with their own filter tab./v1/logs/audit/for backfills and custom tooling.LOG_STREAM_WORKERS(default: 2).📦 Exported event shape
{ "schema_version": 1, "event": { "id": "…", "category": "secrets", "type": "read" }, "timestamp": "2026-07-30T12:00:00+00:00", "actor": { "type": "service_account", "id": "…", "name": "ci-deploy", "token": { "name": "gh-actions" } }, "usr": { "id": "…", "name": "Dev Eloper", "email": "dev@example.com" }, "network": { "client": { "ip": "203.0.113.7" } }, "http": { "useragent": "phase-cli/1.18" }, "phase": { "organisation": { "id": "…", "name": "acme" }, "app": { "id": "…", "name": "backend" }, "environment": { "id": "…", "name": "Production", "type": "PROD" }, "secret": { "id": "…", "path": "/api/payments", "version": 3, "type": "secret" }, "description": "Secret read in backend / Production by ci-deploy" }, "ddsource": "phase", "service": "phase-console", "ddtags": "phase_org:acme,phase_stream:datadog-prod" }Organisation audit events (
"category": "org_audit") carry aphase.resourceblock (type, id, metadata) plusold_values/new_valuesinstead of thesecretblock.🖼️ Screenshots or Demo
💚 Did You...