-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
The consumers (and all exporters are consumers) are required to follow the Error Handling contract which says:
// If the error is non-Permanent then the nextConsumer.Consume*() call should be retried
// with the same data.
and
// If the error is Permanent, then the nextConsumer.Consume*() call should not be
// retried with the same data.
We need a test helper that makes testing exporters for this part of the contract easy.
Helper Inputs
The helper should accept:
- An exporter factory.
- A config for the exporter. We may want to make it easy to allocate a listening port for mock receivers and pass it to the exporter config as the endpoint to send to.
- A mock receiver. E.g. for
otlp
exporter testing we needotlp
receiver that behaves correctly according to OTLP protocol spec and responds as instructed by the helper.
Events to Test for
It is important that all 3 event types happen during the test at least once:
- ConsumeLogs/Traces/Metrics call succeeds at the first try.
- ConsumeLogs/Traces/Metrics call fails once with non-permanent error, then succeeds on the next try.
- ConsumeLogs/Traces/Metrics call fails more than once with non-permanent error, then eventually succeeds.
- ConsumeLogs/Traces/Metrics call fails once with permanent error.
The test helper should provide a data generator that can create data to be given to the exporter.
Test Scenarios
The helper should be possible to configure for testing for permanent errors scenario and must verify:
- No data is lost if mock receiver always succeeds.
- No data is duplicated (in the presence or absence of mock receiver failures).
- Data is not retried by the exporter when the mock receiver indicates a permanent error to the exporter.
The helper should be possible to configure for testing for non-permanent errors scenario and must verify:
- No data is lost.
- No data is duplicated.
- Generated and delivered data content match exactly (but requests may be re-ordered).
Other Requirements
- The test helper should generate concurrent calls to the exporter's ConsumeLogs/Traces/Metrics.
- The mock receiver should be able to accept and respond to concurrent requests from the exporter.
- The helper should support all 3 signal types: logs, traces, metrics.
Metadata
Metadata
Assignees
Labels
No labels