Skip to content
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
2 changes: 2 additions & 0 deletions sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ def _serialized_v1_span_to_serialized_v2_span(
attributes["sentry.release"] = event["release"]
if "environment" in event:
attributes["sentry.environment"] = event["environment"]
if "server_name" in event:
attributes["server.address"] = event["server_name"]
Comment thread
alexander-alderman-webb marked this conversation as resolved.
if "transaction" in event:
attributes["sentry.segment.name"] = event["transaction"]

Expand Down
7 changes: 7 additions & 0 deletions tests/integrations/huggingface_hub/test_huggingface_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ def test_text_generation(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -665,6 +666,7 @@ def test_text_generation_streaming(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -805,6 +807,7 @@ def test_chat_completion(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -953,6 +956,7 @@ def test_chat_completion_streaming(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -1099,6 +1103,7 @@ def test_chat_completion_api_error(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -1297,6 +1302,7 @@ def test_chat_completion_with_tools(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -1456,6 +1462,7 @@ def test_chat_completion_streaming_with_tools(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down
4 changes: 4 additions & 0 deletions tests/integrations/openai/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,7 @@ def test_ai_client_span_responses_api_no_pii(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "openai tx",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -3898,6 +3899,7 @@ def test_ai_client_span_responses_api(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "openai tx",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -4293,6 +4295,7 @@ async def test_ai_client_span_responses_async_api(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "openai tx",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -4576,6 +4579,7 @@ async def test_ai_client_span_streaming_responses_async_api(
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "openai tx",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down
6 changes: 6 additions & 0 deletions tests/tracing/test_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def my_agent():
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test-transaction",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand All @@ -217,6 +218,7 @@ def my_agent():
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test-transaction",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -245,6 +247,7 @@ def my_agent():
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test-transaction",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -389,6 +392,7 @@ def my_agent():
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test-transaction",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand All @@ -412,6 +416,7 @@ def my_agent():
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test-transaction",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down Expand Up @@ -439,6 +444,7 @@ def my_agent():
"sentry.sdk.version": mock.ANY,
"sentry.segment.id": mock.ANY,
"sentry.segment.name": "test-transaction",
"server.address": mock.ANY,
"thread.id": mock.ANY,
"thread.name": mock.ANY,
}
Expand Down
Loading