Skip to content

fix(logs): use server.address instead of sentry.server.address#2040

Merged
Litarnus merged 4 commits intomasterfrom
fix-server-address-logs
Mar 27, 2026
Merged

fix(logs): use server.address instead of sentry.server.address#2040
Litarnus merged 4 commits intomasterfrom
fix-server-address-logs

Conversation

@Litarnus
Copy link
Copy Markdown
Contributor

This PR changes sentry.server.address to server.address so that it properly works with frontend filters

@github-actions github-actions bot marked this pull request as draft March 27, 2026 15:16
@sdk-maintainer-bot
Copy link
Copy Markdown

This PR has been automatically converted to draft. All PRs must start as drafts per our contributing guidelines.

Next steps:

  1. Ensure CI passes
  2. Fill in the PR description completely
  3. Mark as "Ready for review" when you're done

@Litarnus Litarnus self-assigned this Mar 27, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Renamed attribute leaks through test attribute filter
    • Updated the test attribute filter to also exclude server.address, restoring the intended assertion of only user-supplied attributes.

Create PR

Or push these changes by commenting:

@cursor push 031a636f47
Preview (031a636f47)
diff --git a/tests/Logs/LogsAggregatorTest.php b/tests/Logs/LogsAggregatorTest.php
--- a/tests/Logs/LogsAggregatorTest.php
+++ b/tests/Logs/LogsAggregatorTest.php
@@ -54,7 +54,7 @@
                 $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
             )

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

->setAttribute('sentry.release', $options->getRelease())
->setAttribute('sentry.environment', $options->getEnvironment() ?? Event::DEFAULT_ENVIRONMENT)
->setAttribute('sentry.server.address', $options->getServerName())
->setAttribute('server.address', $options->getServerName())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed attribute leaks through test attribute filter

Medium Severity

Renaming sentry.server.address to server.address breaks the testAttributes test. That test filters out internal attributes using !str_starts_with($key, 'sentry.'), which previously excluded sentry.server.address. Now server.address passes through the filter, causing every test case in attributesDataProvider to fail because the actual result includes an unexpected server.address key alongside the user-supplied attributes.

Additional Locations (1)
Fix in Cursor Fix in Web

@Litarnus Litarnus marked this pull request as ready for review March 27, 2026 15:31
@Litarnus Litarnus merged commit 6c3eb0e into master Mar 27, 2026
44 checks passed
@Litarnus Litarnus deleted the fix-server-address-logs branch March 27, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants