Add observability architecture: tiered retention, log-sink contract, profile opt-in - #385
Open
RonaldHensbergen wants to merge 1 commit into
Open
Add observability architecture: tiered retention, log-sink contract, profile opt-in#385RonaldHensbergen wants to merge 1 commit into
RonaldHensbergen wants to merge 1 commit into
Conversation
…profile opt-in Establishes the design foundation for #174 (long-term observability epic): - docs/observability.md: ADR-style guidance covering the two-tier retention model (short-retention raw logs vs. longer-retention structured events), redaction guidance, recommended pipelines, and operator incident-query examples. Documents the ownership boundary against #219 (cds-runtime named connections) and #167 (backend-portable event persistence) per #174's stated scope. - schemas/structured-event.schema.json: provider-neutral JSON Schema for the structured event record (service, profile, environment, timestamp, severity, plus optional correlationId/workloadId/resource/counters). - shared/contracts/log-sink.yaml: new shared contract a centralized log collector module can provide (host/port/protocol/ingestPath/retention), following the existing sql-database/cache-service contract pattern so no module or profile hardcodes a specific logging vendor. - schemas/profile.schema.json + cli/validator.py: adds an optional, generic spec.observability.logShipping block so a profile can opt into log shipping and declare retention tiers without naming a specific module; sink.contractRef is only required to pin a specific log-sink provider, reusing the same <module-id>.<contract-name> resolution already used by spec.outputs.contracts. - tests/test_validator.py: unit coverage for the new validate_observability_config validation rules (shape, retention bounds, contractRef resolution/kind matching). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Establishes the design foundation for #174 (long-term observability epic: tiered Docker log retention and structured runtime events).
This PR delivers the architectural pieces called out in #174's acceptance criteria — architecture guidance, structured event fields, module-agnostic profile opt-in, and redaction/query guidance — while explicitly respecting #174's ownership boundary against #219 (named DB connections) and #167 (event persistence).
Changes
docs/observability.md— ADR-style guidance: two-tier retention design (short-retention raw logs vs. longer-retention structured events), thelog-sinkcontract, profile-level opt-in pattern, redaction guidance, non-mandatory recommended pipelines, and example operator incident queries.schemas/structured-event.schema.json— provider-neutral JSON Schema for the structured event record: requiredservice/profile/environment/timestamp/severity, optionalcorrelationId/workloadId/resource/recordCount/retryCount/message.shared/contracts/log-sink.yaml— new shared contract (kind: log-sink) a centralized log collector module can provide, following the existingsql-database/cache-servicecontract pattern so nothing hardcodes a specific logging vendor.schemas/profile.schema.json+cli/validator.py— adds an optionalspec.observability.logShippingblock. A profile can enable log shipping and declare retention tiers without naming a module;sink.contractRefis only needed to pin a specificlog-sinkprovider, reusing the existing<module-id>.<contract-name>resolution already used byspec.outputs.contracts.docs/architecture.md— links the new doc from the existing "logging and monitoring integration points" bullet.tests/test_validator.py— unit coverage forvalidate_observability_config: shape validation, retention bounds (structuredDays >= rawDays), andsink.contractRefresolution/kind-matching.Validation
make check(lint + full unit test suite, 426 tests) passes.cds validate local-dagster-postgres-supersetstill passes (no regression to existing profiles, sincespec.observabilityis optional).log-sinkcontract againstschemas/contract.schema.json.Out of scope (per #174 and this doc's own "out of scope" section)
log-sinkprovider module (e.g. Loki/Fluent Bit) — that's a natural follow-up once a concrete module is desired.Progresses #174 (left open for follow-up implementation work, per its long-term/epic nature).