-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Implement the logic required to read the outbox table, ordered by created_on, and send a SWatch event message for each outbox record.
See the DESIGN DOCUMENT for implementation details.
This endpoint should support running synchronously and asynchronously based on a the x-rh-swatch-synchronous-request (boolean) header and should default to running asynchronously.
The feature_flag that prevents sending SWatch event messages should block message sending, however, we should always delete the outbox record regardless of its state.
This endpoint should be secured using test and service security schemes (should use an API key via the x-rh-swatch-psk header).
Required Testing
- Verify that on successful SWatch message send, the outbox record is deleted.
- Verify that the feature_flag continues to block SWatch event message sending based on its state.
- Verify that on failure to send SWatch events, the outbox records remain.
- Verify that we have enough coverage around SWatch event ingestion to ensure that it is idempotent and there are no hidden issues.
- Verify that the endpoint is properly secured via component tests.
- Some performance testing should be done on this API so that we can gauge how long it will take to flush a large number of records.
Acceptance Criteria
- The API can be run both asynchronously and synchronously, defaulting to async.
- SWatch message sending should be blocked by the existing feature flag.
- SWatch events should have been sent for all existing outbox records upon completion.
- unit tests
- component tests for ephemeral
- Existing swatch-metrics-hbi component tests are migrated from IQE to the new framework
- Add a depth gauge metric for outbox size to be used by Grafana/alerting
- blocks
-
SWATCH-3786 Configure a job that will flush the outbox on a schedule
-
- Backlog
-
- is blocked by
-
SWATCH-3777 Define and generate an internal REST API for the swatch-metrics-hbi outbox records.
-
- Release Pending
-
-
SWATCH-3778 Implement POST /api/swatch-metrics-hbi/internal/outbox
-
- Release Pending
-
-
SWATCH-3862 Configure swatch-common-security in swatch-metrics-hbi
-
- Closed
-