From 7996ca320e77b29b080028ff3e0284f0e3c88cc3 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Fri, 27 Mar 2026 16:15:28 +0100 Subject: [PATCH 1/4] fix(logs): use `server.address` instead of `sentry.server.address` --- src/Logs/LogsAggregator.php | 2 +- tests/Logs/LogsAggregatorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Logs/LogsAggregator.php b/src/Logs/LogsAggregator.php index 6e7136e06..9d19b08a1 100644 --- a/src/Logs/LogsAggregator.php +++ b/src/Logs/LogsAggregator.php @@ -79,7 +79,7 @@ public function add( $log = (new Log($timestamp, $traceId, $level, $formattedMessage)) ->setAttribute('sentry.release', $options->getRelease()) ->setAttribute('sentry.environment', $options->getEnvironment() ?? Event::DEFAULT_ENVIRONMENT) - ->setAttribute('sentry.server.address', $options->getServerName()) + ->setAttribute('server.address', $options->getServerName()) ->setAttribute('sentry.trace.parent_span_id', $parentSpanId); if ($client instanceof Client) { diff --git a/tests/Logs/LogsAggregatorTest.php b/tests/Logs/LogsAggregatorTest.php index 8f47ce48d..b376eb734 100644 --- a/tests/Logs/LogsAggregatorTest.php +++ b/tests/Logs/LogsAggregatorTest.php @@ -200,7 +200,7 @@ public function testAttributesAreAddedToLogMessage(): void $this->assertSame('1.0.0', $attributes->get('sentry.release')->getValue()); $this->assertSame('production', $attributes->get('sentry.environment')->getValue()); - $this->assertSame('web-server-01', $attributes->get('sentry.server.address')->getValue()); + $this->assertSame('web-server-01', $attributes->get('server.address')->getValue()); $this->assertSame('User %s performed action %s', $attributes->get('sentry.message.template')->getValue()); $this->assertSame('566e3688a61d4bc8', $attributes->get('sentry.trace.parent_span_id')->getValue()); $this->assertSame('sentry.php', $attributes->get('sentry.sdk.name')->getValue()); From d2b6a842bbf69b086ba5ffb666c2d8f17ffffc67 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Fri, 27 Mar 2026 16:21:39 +0100 Subject: [PATCH 2/4] fix tests --- tests/Monolog/LogsHandlerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Monolog/LogsHandlerTest.php b/tests/Monolog/LogsHandlerTest.php index 004a80c38..ea38a98d5 100644 --- a/tests/Monolog/LogsHandlerTest.php +++ b/tests/Monolog/LogsHandlerTest.php @@ -54,7 +54,7 @@ public function testHandle($record, Log $expectedLog): void $log->attributes()->toSimpleArray(), static function (string $key) { // We are not testing Sentry's own attributes here, only the ones the user supplied so filter them out of the expected attributes - return !str_starts_with($key, 'sentry.'); + return !str_starts_with($key, 'sentry.') || $key === 'server.address'; }, \ARRAY_FILTER_USE_KEY ) From cb3048d868163de47938cdbf80a97275bddb34b7 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Fri, 27 Mar 2026 16:23:51 +0100 Subject: [PATCH 3/4] fix tests --- tests/Monolog/LogsHandlerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Monolog/LogsHandlerTest.php b/tests/Monolog/LogsHandlerTest.php index ea38a98d5..e77aa6809 100644 --- a/tests/Monolog/LogsHandlerTest.php +++ b/tests/Monolog/LogsHandlerTest.php @@ -54,7 +54,7 @@ public function testHandle($record, Log $expectedLog): void $log->attributes()->toSimpleArray(), static function (string $key) { // We are not testing Sentry's own attributes here, only the ones the user supplied so filter them out of the expected attributes - return !str_starts_with($key, 'sentry.') || $key === 'server.address'; + return !str_starts_with($key, 'sentry.') && $key !== 'server.address'; }, \ARRAY_FILTER_USE_KEY ) From 82b7a7a6207ce5d1337e87f1cbf0ae47c8d5b386 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Fri, 27 Mar 2026 16:26:27 +0100 Subject: [PATCH 4/4] fix tests --- tests/Logs/LogsAggregatorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Logs/LogsAggregatorTest.php b/tests/Logs/LogsAggregatorTest.php index b376eb734..208203432 100644 --- a/tests/Logs/LogsAggregatorTest.php +++ b/tests/Logs/LogsAggregatorTest.php @@ -54,7 +54,7 @@ public function testAttributes(array $attributes, array $expected): void $log->attributes()->toSimpleArray(), static function (string $key) { // We are not testing internal Sentry attributes here, only the ones the user supplied - return !str_starts_with($key, 'sentry.'); + return !str_starts_with($key, 'sentry.') && $key !== 'server.address'; }, \ARRAY_FILTER_USE_KEY )