fix(logs): use server.address instead of sentry.server.address#2040
fix(logs): use server.address instead of sentry.server.address#2040
server.address instead of sentry.server.address#2040Conversation
|
This PR has been automatically converted to draft. All PRs must start as drafts per our contributing guidelines. Next steps:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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.
- Updated the test attribute filter to also exclude
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()) |
There was a problem hiding this comment.
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.



This PR changes
sentry.server.addresstoserver.addressso that it properly works with frontend filters