Merged
Conversation
…, and audit logs - Implemented OpenTelemetry integration in metrics.py and monitor.py - Enabled structured JSON logging with TraceContextFilter - Implemented UserContext schema and tenant_id propagation in logs - Added EventLogger for persistent audit logging - Updated documentation (README, ops/observability, ops/configuration) - Added verification tests
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.
This pull request introduces a comprehensive observability and audit logging framework across the codebase, enhancing production readiness, compliance, and debuggability. The main improvements include OpenTelemetry-based metrics and tracing, structured JSON logging with tenant and trace correlation, and a persistent forensic audit log. Several configuration options and documentation updates have been added to support these features.
Observability & Audit Logging Enhancements
Introduced OpenTelemetry metrics and tracing:
OBSERVABILITY_EXPORTERandOTEL_EXPORTER_OTLP_ENDPOINTsettings (metrics.py,settings.py,configuration.md,pyproject.toml). [1] [2] [3] [4]observability.md,README.md). [1] [2] [3]Structured logging improvements:
trace_idandtenant_idinto all log records, and updated the JSON formatter to include these fields (logger.py). [1] [2] [3]settings.py).Persistent audit log:
EventLoggerclass that writes sanitized, structured JSON events to a rotating log file for forensic analysis and compliance (event_logger.py).AUDIT_LOG_PATHallows customization of the audit log location (settings.py,configuration.md). [1] [2]Documentation & Planning
observability.mdwith detailed instructions, event structures, and example log entries.remediation_plan_observability.md).README.mdto document the new Observability Plane and its responsibilities. [1] [2]Configuration & Dependency Updates
pyproject.toml).llm.demo.yaml).These changes collectively provide a robust foundation for monitoring, compliance, and operational insight in production environments.