Skip to content

Commit 68f6194

Browse files
ref: Assign server_name to the device.name attribute to avoid server.address conflicts
1 parent 45e02e7 commit 68f6194

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

sentry_sdk/consts.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,12 @@ class SPANDATA:
539539
Example: my_user
540540
"""
541541

542+
DEVICE_NAME = "device.name"
543+
"""
544+
The name of the device. On mobile, this is the user-assigned device name. On servers and desktops, this is typically the hostname.
545+
Example: "localhost"
546+
"""
547+
542548
GEN_AI_AGENT_NAME = "gen_ai.agent.name"
543549
"""
544550
The name of the agent being used.

sentry_sdk/scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def set_global_attributes(self) -> None:
392392

393393
server_name = options.get("server_name")
394394
if server_name:
395-
self.set_attribute(SPANDATA.SERVER_ADDRESS, server_name)
395+
self.set_attribute(SPANDATA.DEVICE_NAME, server_name)
396396

397397
environment = options.get("environment")
398398
if environment:

0 commit comments

Comments
 (0)