Skip to content

feat(google-cloud-serverless)!: Use http.client span op for GCP HTTP requests - #22660

Merged
msonnb merged 4 commits into
developfrom
ms/js-3105-gcp-http-client-op
Jul 28, 2026
Merged

feat(google-cloud-serverless)!: Use http.client span op for GCP HTTP requests#22660
msonnb merged 4 commits into
developfrom
ms/js-3105-gcp-http-client-op

Conversation

@msonnb

@msonnb msonnb commented Jul 27, 2026

Copy link
Copy Markdown
Member

Use http.client instead of http.client.<service> in googleCloudHttpIntegration. The service is now identified by the new server.address attribute. Also added http.request.method.

Part of #22446

Note: MIGRATION.md will be one combined follow up PR

@linear-code

linear-code Bot commented Jul 27, 2026

Copy link
Copy Markdown

JS-3105

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.85 kB - -
@sentry/browser - with treeshaking flags 28.05 kB - -
@sentry/browser (incl. Tracing) 47.42 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.43 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.16 kB - -
@sentry/browser (incl. Tracing, Replay) 86.74 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.16 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.48 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 104.11 kB - -
@sentry/browser (incl. Feedback) 47.16 kB - -
@sentry/browser (incl. sendFeedback) 34.69 kB - -
@sentry/browser (incl. FeedbackAsync) 39.78 kB - -
@sentry/browser (incl. Metrics) 30.92 kB - -
@sentry/browser (incl. Logs) 31.14 kB - -
@sentry/browser (incl. Metrics & Logs) 31.83 kB - -
@sentry/react 31.64 kB - -
@sentry/react (incl. Tracing) 49.64 kB - -
@sentry/vue 34.77 kB - -
@sentry/vue (incl. Tracing) 49.37 kB - -
@sentry/svelte 29.88 kB - -
CDN Bundle 31.89 kB - -
CDN Bundle (incl. Tracing) 47.76 kB - -
CDN Bundle (incl. Logs, Metrics) 33.44 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.8 kB - -
CDN Bundle (incl. Tracing, Replay) 85.4 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.47 kB - -
CDN Bundle - uncompressed 95.12 kB - -
CDN Bundle (incl. Tracing) - uncompressed 143.26 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.83 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.25 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.6 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.18 kB - -
@sentry/nextjs (client) 52.23 kB - -
@sentry/sveltekit (client) 47.84 kB - -
@sentry/core/server 79.78 kB - -
@sentry/core/browser 51.61 kB - -
@sentry/node 122.38 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 85.75 kB - -
@sentry/aws-serverless 93.77 kB -0.01% -2 B 🔽
@sentry/cloudflare (withSentry) - minified 197.56 kB - -
@sentry/cloudflare (withSentry) 486.06 kB - -

View base workflow run

@msonnb
msonnb force-pushed the ms/js-3105-firebase-functions-gcp-op branch from a754190 to 7715393 Compare July 27, 2026 11:44
@msonnb
msonnb force-pushed the ms/js-3105-gcp-http-client-op branch from c3bf82c to a7369f4 Compare July 27, 2026 11:44
@msonnb
msonnb force-pushed the ms/js-3105-firebase-functions-gcp-op branch from 7715393 to 4db7b2b Compare July 27, 2026 12:10
@msonnb
msonnb force-pushed the ms/js-3105-gcp-http-client-op branch from a7369f4 to c40f643 Compare July 27, 2026 12:10
@msonnb
msonnb changed the base branch from ms/js-3105-firebase-functions-gcp-op to develop July 27, 2026 13:07
@msonnb
msonnb force-pushed the ms/js-3105-gcp-http-client-op branch 5 times, most recently from 163c51e to 86a9875 Compare July 27, 2026 13:49
msonnb and others added 2 commits July 28, 2026 13:10
…P requests

The endpoint-derived suffix fragmented grouping and was unbounded for
non-`googleapis.com` endpoints. Service identity moves to the
`server.address` attribute; `http.request.method` is now set as well.

Ref: JS-3105

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@msonnb
msonnb force-pushed the ms/js-3105-gcp-http-client-op branch from 86a9875 to 7a82c49 Compare July 28, 2026 11:11
@msonnb
msonnb marked this pull request as ready for review July 28, 2026 11:11
@msonnb
msonnb requested a review from a team as a code owner July 28, 2026 11:11
@msonnb
msonnb requested review from isaacs and mydea and removed request for a team July 28, 2026 11:11
Comment thread packages/google-cloud-serverless/test/integrations/google-cloud-http.test.ts Outdated
Comment on lines +77 to +79
function getServerAddress(apiEndpoint: string): string {
const url = parseStringToURLObject(apiEndpoint);
return url && !isURLObjectRelative(url) ? url.host : apiEndpoint;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The code uses url.host to set the SERVER_ADDRESS attribute, which can incorrectly include the port number, violating OpenTelemetry semantic conventions.
Severity: LOW

Suggested Fix

To ensure compliance with OpenTelemetry conventions and maintain consistency within the codebase, change url.host to url.hostname. This will correctly extract only the hostname from the URL, excluding any port number.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/google-cloud-serverless/src/integrations/google-cloud-http.ts#L77-L79

Potential issue: The code uses `url.host` to populate the `SERVER_ADDRESS` OpenTelemetry
attribute. According to OpenTelemetry semantic conventions, `server.address` should only
contain the hostname, with the port stored in a separate `server.port` attribute. Using
`url.host` can include the port if a non-standard port is present in the URL. While this
is unlikely with standard Google Cloud API endpoints, it violates the specification and
is inconsistent with other parts of the codebase that correctly use `url.hostname`. This
could lead to incorrect telemetry data in environments using custom endpoints with
non-standard ports.

Did we get this right? 👍 / 👎 to inform future reviews.

@msonnb
msonnb force-pushed the ms/js-3105-gcp-http-client-op branch from 006b1d0 to a747a97 Compare July 28, 2026 13:57
@msonnb
msonnb force-pushed the ms/js-3105-gcp-http-client-op branch from a747a97 to 75e0096 Compare July 28, 2026 14:43
@msonnb
msonnb enabled auto-merge (squash) July 28, 2026 14:44

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 75e0096. Configure here.

@msonnb
msonnb merged commit d7eae37 into develop Jul 28, 2026
43 checks passed
@msonnb
msonnb deleted the ms/js-3105-gcp-http-client-op branch July 28, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants