Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/sentry/preprod/eap/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from sentry.utils.arroyo_producer import SingletonProducer, get_arroyo_producer
from sentry.utils.kafka_config import get_topic_definition

THIRTEEN_MONTHS = 396 # 13 months in days
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



def produce_preprod_size_metric_to_eap(
size_metric: PreprodArtifactSizeMetrics,
Expand Down Expand Up @@ -109,7 +111,7 @@ def produce_preprod_size_metric_to_eap(
timestamp=proto_timestamp,
trace_id=trace_id,
received=received,
retention_days=90, # Default retention for preprod data
retention_days=THIRTEEN_MONTHS, # Default retention for preprod data

This comment was marked as outdated.

attributes={k: anyvalue(v) for k, v in attributes.items() if v is not None},
client_sample_rate=1.0,
server_sample_rate=1.0,
Expand Down Expand Up @@ -217,7 +219,7 @@ def produce_preprod_build_distribution_to_eap(
timestamp=proto_timestamp,
trace_id=trace_id,
received=received,
retention_days=90,
retention_days=THIRTEEN_MONTHS,
attributes={k: anyvalue(v) for k, v in attributes.items() if v is not None},
client_sample_rate=1.0,
server_sample_rate=1.0,
Expand Down
5 changes: 3 additions & 2 deletions tests/sentry/preprod/eap/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from sentry.conf.types.kafka_definition import Topic, get_topic_codec
from sentry.models.commitcomparison import CommitComparison
from sentry.preprod.eap.write import (
THIRTEEN_MONTHS,
produce_preprod_build_distribution_to_eap,
produce_preprod_size_metric_to_eap,
)
Expand Down Expand Up @@ -82,7 +83,7 @@ def test_write_preprod_size_metric_encodes_all_fields_correctly(self, mock_produ
assert trace_item.organization_id == self.organization.id
assert trace_item.project_id == self.project.id
assert trace_item.item_type == TraceItemType.TRACE_ITEM_TYPE_PREPROD
assert trace_item.retention_days == 90
assert trace_item.retention_days == THIRTEEN_MONTHS

attrs = trace_item.attributes

Expand Down Expand Up @@ -231,7 +232,7 @@ def test_write_preprod_build_distribution_encodes_all_fields_correctly(self, moc
assert trace_item.organization_id == self.organization.id
assert trace_item.project_id == self.project.id
assert trace_item.item_type == TraceItemType.TRACE_ITEM_TYPE_PREPROD
assert trace_item.retention_days == 90
assert trace_item.retention_days == THIRTEEN_MONTHS

attrs = trace_item.attributes

Expand Down
Loading