-
[OPIK-2095] [BE] Implement Webhook event handler logging system (#3463)
发布于
2025-09-30 14:44:23 +00:00 - [OPIK-2095] [BE] Refactor Redis stream listeners to extend BaseRedisSubscriber
- Refactored OnlineScoringBaseScorer to extend BaseRedisSubscriber instead of duplicating Redis stream functionality
- Created OnlineScoringStreamConfigurationAdapter to bridge OnlineScoringConfig with StreamConfiguration interface
- Added missing stream configurations in test config for trace thread scorers
- Eliminated code duplication while preserving all existing functionality
- All concrete scorer implementations now inherit common Redis stream handling logic
- OPIK-2095: Add reactive webhook subscriber with retry logic
- Add WebhookSubscriber for processing webhook events from Redis streams
- Add WebhookHttpClient with configurable retry mechanism using exponential backoff
- Add WebhookPublisher for publishing events to Redis streams
- Convert WebhookEventTypes from constants to enum with JSON serialization
- Add WebhookConfig with comprehensive configuration options
- Add WebhookEvent DTO with generic payload support
- Add comprehensive unit tests for WebhookSubscriber
- Configure default webhook settings in config.yml and config-test.yml
- Implement conditional retry logic to respect max retry limits
- [OPIK-2095] [BE] Refactor Redis stream listeners to extend BaseRedisSubscriber
- Refactored OnlineScoringBaseScorer to extend BaseRedisSubscriber instead of duplicating Redis stream functionality
- Created OnlineScoringStreamConfigurationAdapter to bridge OnlineScoringConfig with StreamConfiguration interface
- Added missing stream configurations in test config for trace thread scorers
- Eliminated code duplication while preserving all existing functionality
- All concrete scorer implementations now inherit common Redis stream handling logic
- [OPIK-2095] [BE] Address GitHub PR comments - Fix configuration formatting and default values
- Fix missing space in config-test.yml comment (# Default:1s -> # Default: 1s)
- Update WebhookConfig maxRetries default from 4 to 3 for consistency with documentation
- OPIK-2095: Implement webhook event handler logging system
- Create logs table for webhook event tracking with markers-based filtering
- Implement WebhookEventHandlerLogsDAO with dynamic marker filtering using StringTemplate
- Add comprehensive integration tests with WireMock and real database
- Update WebhookHttpClient to use consistent MDC logging keys
- Add validation annotations to WebhookEvent
- Extract hardcoded strings to constants in WebhookHttpClient
- Remove redundant JsonProperty annotations from WebhookEvent
- Update UserLogTableFactory to register webhook logs DAO
- Add webhook-specific constants to UserLog enum
Tests verify end-to-end webhook sending and database logging functionality.
-
Fix errors
-
Rename
-
Fix import
-
Address PR review
-
Fix table name
-
Fix dao
-
Fix: Only add offset if page and size are present
Co-authored-by: thiagoh thiagoh@comet.com
Co-authored-by: Cursor Agent cursoragent@cursor.com
下载附件