feat: Implement OpenTelemetry audit exporter (#136)#161
Merged
Conversation
Add OtelExporter that sends audit events to OTLP collectors using gRPC protocol. Includes event-to-LogRecord mapping with severity level classification and resource attributes for service identification. Supports integration with observability platforms like Jaeger and Grafana Tempo.
HIGH: - Fix test code compilation by using tuple indexing (.0, .1) for KeyValue attributes instead of struct field access - Add endpoint URL validation using url::Url::parse() with error context - Add HTTPS validation warning for insecure HTTP endpoints MEDIUM: - Replace Mutex with RwLock for logger_provider since emit() only requires read access, improving concurrent performance - Add TLS requirements documentation in endpoint parameter docs - Convert all synchronous tests to async with #[tokio::test] to satisfy gRPC client initialization requirements Dependencies: - Add url crate 2.5 for URL parsing and validation
Document the newly implemented OpenTelemetry audit exporter: - OTLP/gRPC protocol support - Event to LogRecord mapping - Severity level mapping - Usage example with code snippet - Move OpenTelemetry from "planned" to "implemented"
Member
Author
PR Finalization ReportProject Structure Discovered
ChecklistTests
Note: Tests Documentation
Code Quality
Changes Made
SummaryThe OpenTelemetry audit exporter implementation is complete with:
|
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
Implements OpenTelemetry (OTLP) exporter for audit events, enabling integration with observability platforms like Jaeger, Grafana Tempo, and cloud monitoring services.
Changes
OtelExporterstruct that implementsAuditExportertraitAuditManagerDependencies Added
opentelemetry = "0.21"opentelemetry_sdk = { version = "0.21", features = ["rt-tokio", "logs"] }opentelemetry-otlp = { version = "0.14", features = ["grpc-tonic", "logs"] }Testing
cargo build --libsucceedscargo clippypasses with no warningscargo fmtappliedRelated Issues
Closes #136