-
[OPIK-2095] Implement reactive webhook alert debouncing with config change support (#3482)
发布于
2025-10-03 13:38:46 +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
-
[OPIK-2095] [BE] Implement webhook event debouncing with timestamp-based aggregation
-
[OPIK-2095] [BE] Refactor webhook architecture - WebhookSubscriber only sends HTTP, add WebhookEventStorageService
-
[OPIK-2095] [BE] Refine webhook alert architecture - Alert entity verifies events, AlertJob manages buckets
-
feat: implement webhook alert debouncing configuration change handling
- Store windowSize in Redis buckets to preserve configuration at creation time
- Existing buckets continue using their original debouncing window
- New buckets created after config changes use the updated window
- Fix TTL behavior: set only on bucket creation, not refreshed on subsequent events
- Add comprehensive test coverage in AlertBucketServiceTest (9 tests)
- Update documentation with TTL behavior and configuration change handling
- Remove obsolete WebhookEventAggregationTest
- Fix WebhookSubscriber test files to use correct API (sendWebhook instead of processEvent)
This ensures that configuration changes don't affect in-flight alert aggregations,
allowing smooth transitions between different debouncing window settings.-
Fix merge conflicts
-
fix: address PR review comments for webhook alert debouncing
- Replace blocking .block() calls with StepVerifier in AlertBucketServiceTest for better reactive testing
- Remove unnecessary cast in AlertBucketService.getBucketEventIds()
- Fix typo: rename 'makers' to 'markers' in AlertEventLogsDAO
- Fix pagination null pointer bug in AlertEventLogsDAO when page is provided without size
- Add missing WebhookEvent fields: alertId, userName, and createdAt in WebhookPublisher
- Update WebhookPublisher method signatures to accept alertId parameter
- Update AlertJob to pass alertId when publishing webhook events
- Improve empty lambda pattern in AlertJob subscription for clarity
All changes address Copilot and Cursor bot review comments from PR #3482.
-
Fix issues
-
Fix values
-
Fix values
下载附件