Skip to content

feat(google-cloud-serverless): Emit low cardinality function.gcp span names - #24060

Merged
Lms24 merged 5 commits into
developfrom
lms/feat-gcp-faas-span-names
Sep 8, 2026
Merged

feat(google-cloud-serverless): Emit low cardinality function.gcp span names#24060
Lms24 merged 5 commits into
developfrom
lms/feat-gcp-faas-span-names

Conversation

@Lms24

@Lms24 Lms24 commented Sep 4, 2026

Copy link
Copy Markdown
Member

Adjusts function.gcp spans:

  • when span streaming is enabled, span names will be the function name (which we can read from env vars) or a string fallback
  • when disabled, we keep the current names. To ensure seamless static->streaming migrations, feat(descriptions): Add more fine grained function.gcp span description rules sentry-conventions#624 adds new needed description rules to conventions.
  • added new gcp.function.context attributes which were previously only set on the transaction event context
  • adjusted unit tests and added tests for streaming names. We currently have no integration tests for gcp so this will have to do.

ref #23954

@Lms24 Lms24 self-assigned this Sep 4, 2026
Comment thread packages/google-cloud-serverless/src/gcpfunction/http.ts Outdated
@Lms24
Lms24 force-pushed the lms/feat-gcp-faas-span-names branch from 0ea6adc to ae80636 Compare September 4, 2026 08:56
// not yet in conventions but this attribute will also determine the span description
[GCP_FUNCTION_CONTEXT_EVENT_TYPE]: context.eventType,
[GCP_FUNCTION_CONTEXT_EVENT_ID]: context.eventId,
[GCP_FUNCTION_CONTEXT_RESOURCE]: context.resource,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Object resource set as span attribute

Medium Severity

gcp.function.context.resource is written from context.resource with no type check. Legacy GCP event contexts often supply resource as an object (service, name, type), including Pub/Sub. setAttribute stores that object, so spans can carry a non-primitive attribute. The existing gcpContextIntegration already skips non-string resource values for this reason.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ae80636. Configure here.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.8 kB - -
@sentry/browser - with treeshaking flags 27.11 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27 kB - -
@sentry/browser (incl. Tracing) 49.22 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.12 kB - -
@sentry/browser (incl. Tracing, Replay) 88.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.95 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.37 kB - -
@sentry/browser (incl. Feedback) 46.3 kB - -
@sentry/browser (incl. sendFeedback) 33.86 kB - -
@sentry/browser (incl. FeedbackAsync) 38.97 kB - -
@sentry/browser (incl. Metrics) 29.82 kB - -
@sentry/browser (incl. Logs) 30.09 kB - -
@sentry/browser (incl. Metrics & Logs) 30.75 kB - -
@sentry/react 30.55 kB - -
@sentry/react (incl. Tracing) 51.56 kB - -
@sentry/vue 36.05 kB - -
@sentry/vue (incl. Tracing) 51.48 kB - -
@sentry/svelte 28.83 kB - -
CDN Bundle 30.55 kB - -
CDN Bundle (incl. Tracing) 49.74 kB - -
CDN Bundle (incl. Logs, Metrics) 32.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB - -
CDN Bundle (incl. Tracing, Replay) 87.29 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.21 kB - -
CDN Bundle - uncompressed 90.46 kB - -
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.03 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB - -
@sentry/nextjs (client) 54 kB - -
@sentry/sveltekit (client) 49.65 kB - -
@sentry/core/server 36.99 kB - -
@sentry/core/browser 13.55 kB - -
@sentry/node 127.81 kB +0.02% +22 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.61 kB - -
@sentry/node - without tracing 88.73 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 107.05 kB +0.02% +18 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 201.98 kB - -
@sentry/cloudflare (withSentry) 502.68 kB - -

View base workflow run

@Lms24
Lms24 marked this pull request as ready for review September 4, 2026 09:41
@Lms24
Lms24 requested a review from a team as a code owner September 4, 2026 09:41
@Lms24
Lms24 requested review from isaacs and mydea and removed request for a team September 4, 2026 09:41
@Lms24
Lms24 force-pushed the lms/feat-gcp-faas-span-names branch from ae80636 to a568b71 Compare September 4, 2026 11:11

@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.

There are 2 total unresolved issues (including 1 from previous review).

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 a568b71. Configure here.

Comment thread packages/google-cloud-serverless/src/gcpfunction/http.ts
@Lms24
Lms24 force-pushed the lms/feat-gcp-faas-span-names branch from a568b71 to f6bba3d Compare September 4, 2026 12:11

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just some minor comments, lgtm!

Comment thread packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts Outdated
Comment thread packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts Outdated
Comment thread packages/google-cloud-serverless/src/gcpfunction/events.ts Outdated
Comment thread packages/google-cloud-serverless/src/gcpfunction/events.ts Outdated
@Lms24
Lms24 force-pushed the lms/feat-gcp-faas-span-names branch from f6bba3d to 43dfada Compare September 8, 2026 14:23
Comment thread packages/google-cloud-serverless/src/gcpfunction/events.ts
@Lms24
Lms24 merged commit 6e3a4e3 into develop Sep 8, 2026
310 of 313 checks passed
@Lms24
Lms24 deleted the lms/feat-gcp-faas-span-names branch September 8, 2026 14:44
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