Skip to content
Merged
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
5 changes: 3 additions & 2 deletions src/sentry/preprod/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,14 @@ def _assemble_preprod_artifact_size_analysis(
except (ValueError, AttributeError):
artifact_type_name = "unknown"

# TODO: Remove project_id_value once this metric's volume get too big to avoid high cardinality cost issues
metrics.distribution(
"preprod.size_analysis.results_e2e",
e2e_size_analysis_duration.total_seconds(),
sample_rate=1.0,
tags={
"project_id": project.id,
"organization_id": org_id,
"project_id_value": project.id,
"organization_id_value": org_id,
"artifact_type": artifact_type_name,
},
Comment on lines 486 to 491
Copy link

Choose a reason for hiding this comment

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

Bug: Metric tag organization_id is inconsistently renamed to organization_id_value in src/sentry/preprod/tasks.py compared to similar metrics.
Severity: HIGH | Confidence: High

🔍 Detailed Analysis

The _assemble_preprod_artifact_size_analysis function in src/sentry/preprod/tasks.py renames the organization_id metric tag to organization_id_value. This is inconsistent with the compare.results_e2e metric in src/sentry/preprod/size_analysis/tasks.py, which uses organization_id without the _value suffix. This discrepancy in tag naming across similar metrics within the preprod module could lead to issues for downstream consumers like monitoring dashboards or alerts that expect consistent tag structures.

💡 Suggested Fix

Ensure consistent naming for the organization_id metric tag. Either revert organization_id_value to organization_id in src/sentry/preprod/tasks.py or update existing similar metrics to use organization_id_value.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/preprod/tasks.py#L486-L491

Potential issue: The `_assemble_preprod_artifact_size_analysis` function in
`src/sentry/preprod/tasks.py` renames the `organization_id` metric tag to
`organization_id_value`. This is inconsistent with the `compare.results_e2e` metric in
`src/sentry/preprod/size_analysis/tasks.py`, which uses `organization_id` without the
`_value` suffix. This discrepancy in tag naming across similar metrics within the
preprod module could lead to issues for downstream consumers like monitoring dashboards
or alerts that expect consistent tag structures.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2832214

)
Expand Down
Loading