forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add new AuditLogRecordProcessor + AuditLog[File]Store #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hilmarf
wants to merge
35
commits into
main
Choose a base branch
from
AuditLog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
This reverts commit 4a58b10.
Signed-off-by: Hilmar Falkenberg <[email protected]>
This reverts commit dd43864.
This reverts commit 4a58b10.
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
instead of using individual values Signed-off-by: Hilmar Falkenberg <[email protected]>
This reverts commit dd43864.
This reverts commit a3fbb45.
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
Signed-off-by: Hilmar Falkenberg <[email protected]>
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 audit logging capability to the OpenTelemetry Java SDK, focusing on file-based storage and processing of log records. The main changes are:
AuditLogRecordProcessor.java
&AuditLogRecordProcessorBuilder.java
Introduces a processor for audit log records, enabling custom handling and export logic. Builder pattern allows flexible configuration of the processor.
AuditLogStore.java
Defines the interface for audit log storage, enabling extensibility for different storage backends.
AuditException.java
&AuditExceptionHandler.java
Adds custom exception and handler classes for robust error management in audit logging operations.
AuditLogFileStore.java
Implements a thread-safe, file-based store for audit logs. Supports concurrent read/write operations using a ReadWriteLock. Prevents duplicate log entries by maintaining a set of record IDs. Uses Jackson for JSON serialization/deserialization of log records. Provides methods to save, retrieve, and remove log records. Handles file creation, directory management, and ensures file accessibility.
JsonLogRecordData.java
Provides a JSON-serializable representation of log records for storage and retrieval.
MultiLogRecordExporter.java
Refactored to simplify handling of multiple exporters. Improved retry logic and error handling for log export operations.
build.gradle.kts
Adds com.fasterxml.jackson.core:jackson-databind as a compile-only dependency for JSON processing.
AuditLogFileStoreTest.java
Unit tests for the file-based audit log store, covering save, retrieve, and remove operations.
AuditLogRecordProcessorTest.java
Tests for the new processor, ensuring correct processing and export of audit log records.
BatchLogRecordProcessorTest.java
Additional tests to verify batch processing logic in the context of audit logs.
Summary
This PR significantly enhances the OpenTelemetry Java SDK with robust, extensible audit logging capabilities, including file-based storage, custom processing, and improved exporter logic. The changes are well-tested and modular, laying the groundwork for future audit log features and integrations.