Skip to content

Commit 71f3a19

Browse files
authored
chore(trace ai queries): Send slug in req (#95170)
- pass in slug in request body to make it easier to log in langfuse - sending it in request reduces a future rpc
1 parent c61db22 commit 71f3a19

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/sentry/api/endpoints/trace_explorer_ai_query.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@
2323
from rest_framework.request import Request
2424

2525

26-
def send_translate_request(org_id: int, project_ids: list[int], natural_language_query: str) -> Any:
26+
def send_translate_request(
27+
org_id: int, org_slug: str, project_ids: list[int], natural_language_query: str
28+
) -> Any:
2729
"""
2830
Sends a request to seer to create the initial cached prompt / setup the AI models
2931
"""
3032
body = orjson.dumps(
3133
{
3234
"org_id": org_id,
35+
"org_slug": org_slug,
3336
"project_ids": project_ids,
3437
"natural_language_query": natural_language_query,
3538
}
@@ -102,7 +105,9 @@ def post(request: Request, organization: Organization) -> Response:
102105
{"detail": "Seer is not properly configured."},
103106
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
104107
)
105-
data = send_translate_request(organization.id, project_ids, natural_language_query)
108+
data = send_translate_request(
109+
organization.id, organization.slug, project_ids, natural_language_query
110+
)
106111

107112
# XXX: This is a fallback to support the old response format until we fully support using multiple queries on the frontend
108113
if "responses" in data and use_flyout:

0 commit comments

Comments
 (0)