Skip to content

Commit c1a4196

Browse files
authored
fix(llm-detector): Use project's platform instead of "other" (#103090)
uses the project's platform instead of other for llm detected issues. also removes unnecessary tag fixes https://linear.app/getsentry/issue/ID-1080/add-platform-to-occurrences
1 parent 8e1f003 commit c1a4196

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/sentry/tasks/llm_issue_detection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def create_issue_occurrence_from_detection(
8181
event_id = uuid4().hex
8282
occurrence_id = uuid4().hex
8383
detection_time = datetime.now(UTC)
84+
project = Project.objects.get_from_cache(id=project_id)
8485

8586
fingerprint = [f"llm-detected-{detected_issue.title}-{transaction_name}"]
8687

@@ -125,13 +126,12 @@ def create_issue_occurrence_from_detection(
125126
event_data = {
126127
"event_id": event_id,
127128
"project_id": project_id,
128-
"platform": "other",
129+
"platform": project.platform or "other",
129130
"received": detection_time.isoformat(),
130131
"timestamp": detection_time.isoformat(),
131132
"tags": {
132133
"trace_id": trace.trace_id,
133134
"transaction": transaction_name,
134-
"llm_detected": "true",
135135
},
136136
}
137137

tests/sentry/tasks/test_llm_issue_detection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def test_create_issue_occurrence_from_detection(self, mock_produce_occurrence):
120120
assert event_data["platform"] == "other"
121121
assert event_data["tags"]["trace_id"] == "abc123xyz"
122122
assert event_data["tags"]["transaction"] == "test_transaction"
123-
assert event_data["tags"]["llm_detected"] == "true"
124123
assert "event_id" in event_data
125124
assert "received" in event_data
126125
assert "timestamp" in event_data

0 commit comments

Comments
 (0)