Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log usage of niche features #893

Merged
merged 1 commit into from
Nov 14, 2024
Merged
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
4 changes: 4 additions & 0 deletions services/report/raw_upload_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ def clear_carryforward_sessions(
if to_partially_overwrite_flags:
# NOTE: this here might be the most accurate counter, as it takes into account the
# actual `to_merge_flags` that were used for this particular upload.
sentry_sdk.capture_message(
"Customer is using `carryforward_mode=labels` feature",
extras={"flags": to_partially_overwrite_flags},
)
LABELS_USAGE.labels(codepath="carryforward_cleanup").inc()

to_fully_overwrite_flags = flags_under_carryforward_rules.difference(
Expand Down
15 changes: 9 additions & 6 deletions tasks/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
repoid: int,
commitid: str,
report_type: ReportType = ReportType.COVERAGE,
report_code: Optional[str] = None,
redis_connection: Optional[Redis] = None,
report_code: str | None = None,
redis_connection: Redis | None = None,
):
self.repoid = repoid
self.commitid = commitid
Expand All @@ -89,8 +89,6 @@

def log_extra(self, **kwargs) -> dict:
return dict(
repoid=self.repoid,
commit=self.commitid,
report_type=self.report_type.value,
report_code=self.report_code,
**kwargs,
Expand Down Expand Up @@ -286,8 +284,8 @@
db_session: Session,
repoid: int,
commitid: str,
report_type="coverage",
report_code=None,
report_type: str = "coverage",
report_code: str | None = None,
*args,
**kwargs,
):
Expand All @@ -297,6 +295,11 @@
report_type=ReportType(report_type),
report_code=report_code,
)
if report_code:
sentry_sdk.capture_message(

Check warning on line 299 in tasks/upload.py

View check run for this annotation

Codecov Notifications / codecov/patch

tasks/upload.py#L299

Added line #L299 was not covered by tests
"Customer is using non-default `report_code`",
tags={"report_type": report_type, "report_code": report_code},
)
checkpoints = upload_context.get_checkpoints(kwargs)
log.info("Received upload task", extra=upload_context.log_extra())

Expand Down
Loading