Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: tune gcp detector span filter function
  • Loading branch information
david-luna committed Mar 27, 2025
commit 878926961c9c3ed98ec770c1ded62c967bd26d30
12 changes: 7 additions & 5 deletions packages/opentelemetry-node/test/testutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@
*/
function filterOutGcpDetectorSpans(spans) {
// Filter out GCP resource detector spans for testing.
return spans.filter(

Check failure on line 97 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎········`
(s) =>
s.scope.name !== '@opentelemetry/instrumentation-http' ||
!['169.254.169.254', 'metadata.google.internal.'].includes(
s.attributes['server.address']
)
(s) => {
if (s.scope.name !== '@opentelemetry/instrumentation-http') {

Check failure on line 99 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Delete `····`
return true;

Check failure on line 100 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Delete `····`
}

Check failure on line 101 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Delete `····`
const urlAttr = s.attributes['http.url'] || s.attributes['url.full'] || '';

Check failure on line 102 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Replace `············const·urlAttr·=` with `········const·urlAttr·=⏎···········`
return !urlAttr.endsWith('/computeMetadata/v1/instance');

Check failure on line 103 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Replace `············` with `········`
}

Check failure on line 104 in packages/opentelemetry-node/test/testutils.js

View workflow job for this annotation

GitHub Actions / lint

Replace `····}⏎····` with `}`
);
}

Expand Down
Loading