-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(consumers): Add option to enable dlq for sentry unified consumers (
#58474) - Adds a `--enable-dql` for devserver option to specify which consumers to enable dlq - Adds configuration about dlq topic for `ingest-metrics`, and `ingest-performance-metrics`
- Loading branch information
1 parent
448ab26
commit b85278d
Showing
5 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import List | ||
|
||
import pytest | ||
|
||
from sentry.conf.types.consumer_definition import ConsumerDefinition, validate_consumer_definition | ||
from sentry.consumers import KAFKA_CONSUMERS | ||
from sentry.testutils.cases import TestCase | ||
|
||
|
||
class ConsumersDefinitionTest(TestCase): | ||
def test_exception_on_invalid_consumer_definition(self): | ||
invalid_definitions: List[ConsumerDefinition] = [ | ||
{ | ||
"topic": "topic", | ||
"strategy_factory": "sentry.sentry_metrics.consumers.indexer.parallel.MetricsConsumerStrategyFactory", | ||
"static_args": { | ||
"ingest_profile": "release-health", | ||
}, | ||
"dlq_max_invalid_ratio": 0.01, | ||
"dlq_max_consecutive_count": 1000, | ||
} | ||
] | ||
for invalid_definition in invalid_definitions: | ||
with pytest.raises(ValueError): | ||
validate_consumer_definition(invalid_definition) | ||
|
||
def test_kafka_consumer_definition_validity(self): | ||
for definition in KAFKA_CONSUMERS.values(): | ||
validate_consumer_definition(definition) |