Skip to content

Add pubsub.subscription to GCP pubsub pull subsciptions#7446

Open
nina9753 wants to merge 9 commits intomasterfrom
nina.rei/fix/add_gcp_pubsub_subscription
Open

Add pubsub.subscription to GCP pubsub pull subsciptions#7446
nina9753 wants to merge 9 commits intomasterfrom
nina.rei/fix/add_gcp_pubsub_subscription

Conversation

@nina9753
Copy link
Contributor

@nina9753 nina9753 commented Feb 5, 2026

What does this PR do?

follow up to #6260 Add pubsub.subscription to GCP pubsub pull subscriptions span tags for related resources tab in the serverless UI. This will allow pubsub metrics to be correlated to the Cloud Run services being triggered (as shown in org 2 here)

Motivation

Additional Notes

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.59%. Comparing base (e3344ae) to head (085eaf6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7446      +/-   ##
==========================================
- Coverage   80.33%   79.59%   -0.75%     
==========================================
  Files         731      730       -1     
  Lines       31093    30983     -110     
==========================================
- Hits        24980    24660     -320     
- Misses       6113     6323     +210     
Flag Coverage Δ
aiguard-macos 39.08% <ø> (-0.11%) ⬇️
aiguard-ubuntu 39.12% <ø> (-0.11%) ⬇️
aiguard-windows 38.97% <ø> (-0.11%) ⬇️
apm-capabilities-tracing-macos 48.85% <ø> (+<0.01%) ⬆️
apm-capabilities-tracing-ubuntu 48.85% <ø> (+<0.01%) ⬆️
apm-capabilities-tracing-windows 48.58% <ø> (+0.05%) ⬆️
apm-integrations-child-process 38.57% <ø> (-0.11%) ⬇️
apm-integrations-couchbase-18 37.33% <ø> (-0.25%) ⬇️
apm-integrations-couchbase-eol 37.81% <ø> (-0.10%) ⬇️
apm-integrations-oracledb 38.00% <ø> (-0.10%) ⬇️
appsec-express 55.37% <ø> (-0.07%) ⬇️
appsec-fastify 51.99% <ø> (-0.08%) ⬇️
appsec-graphql 52.32% <ø> (-0.07%) ⬇️
appsec-kafka 44.64% <ø> (-0.09%) ⬇️
appsec-ldapjs 44.31% <ø> (-0.09%) ⬇️
appsec-lodash 43.99% <ø> (-0.09%) ⬇️
appsec-macos 58.48% <ø> (-0.07%) ⬇️
appsec-mongodb-core 49.19% <ø> (+0.03%) ⬆️
appsec-mongoose 49.87% <ø> (-0.09%) ⬇️
appsec-mysql 51.26% <ø> (-0.08%) ⬇️
appsec-node-serialize 43.50% <ø> (-0.09%) ⬇️
appsec-passport 48.10% <ø> (-0.09%) ⬇️
appsec-postgres 51.03% <ø> (-0.10%) ⬇️
appsec-sourcing 42.84% <ø> (-0.09%) ⬇️
appsec-template 43.67% <ø> (-0.09%) ⬇️
appsec-ubuntu 58.50% <ø> (-0.07%) ⬇️
appsec-windows 58.36% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-bluebird 32.25% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-body-parser 40.73% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-child_process 37.88% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-cookie-parser 34.51% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express 34.85% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.65% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-session 40.41% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-fs 31.85% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-generic-pool 29.81% <ø> (ø)
instrumentations-instrumentation-http 39.62% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-knex 32.25% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-mongoose 33.62% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-multer 40.47% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-mysql2 38.27% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport 40.77% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport-http 40.74% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport-local 40.74% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-pg 37.79% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-promise 32.18% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-promise-js 32.18% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-q 32.23% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-url 32.15% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-when 32.20% <ø> (-0.11%) ⬇️
llmobs-ai 41.41% <ø> (-0.10%) ⬇️
llmobs-anthropic 40.63% <ø> (-0.10%) ⬇️
llmobs-bedrock 39.51% <ø> (-0.09%) ⬇️
llmobs-google-genai 40.12% <ø> (-0.09%) ⬇️
llmobs-langchain 39.66% <ø> (-0.08%) ⬇️
llmobs-openai 44.48% <ø> (-0.09%) ⬇️
llmobs-vertex-ai 40.34% <ø> (-0.17%) ⬇️
platform-core 28.09% <ø> (ø)
platform-esbuild 31.49% <ø> (ø)
platform-instrumentations-misc 39.62% <ø> (ø)
platform-shimmer 34.83% <ø> (ø)
platform-unit-guardrails 30.37% <ø> (ø)
plugins-azure-event-hubs 22.64% <ø> (ø)
plugins-azure-service-bus 22.08% <ø> (ø)
plugins-bullmq 43.71% <ø> (-0.10%) ⬇️
plugins-cassandra 38.04% <ø> (-0.10%) ⬇️
plugins-cookie 23.69% <ø> (ø)
plugins-cookie-parser 23.50% <ø> (ø)
plugins-crypto 22.88% <ø> (ø)
plugins-dd-trace-api 38.42% <ø> (-0.11%) ⬇️
plugins-express-mongo-sanitize 23.67% <ø> (ø)
plugins-express-session 23.46% <ø> (ø)
plugins-fastify 42.53% <ø> (-0.10%) ⬇️
plugins-fetch 38.60% <ø> (-0.10%) ⬇️
plugins-fs 38.67% <ø> (-0.11%) ⬇️
plugins-generic-pool 22.68% <ø> (ø)
plugins-google-cloud-pubsub ?
plugins-grpc 41.29% <ø> (-0.10%) ⬇️
plugins-handlebars 23.71% <ø> (ø)
plugins-hapi 40.43% <ø> (-0.10%) ⬇️
plugins-hono 40.63% <ø> (-0.10%) ⬇️
plugins-ioredis 38.47% <ø> (-0.11%) ⬇️
plugins-knex 23.51% <ø> (ø)
plugins-ldapjs 21.28% <ø> (ø)
plugins-light-my-request 23.15% <ø> (ø)
plugins-limitd-client 32.55% <ø> (-0.11%) ⬇️
plugins-lodash 22.74% <ø> (ø)
plugins-mariadb 39.61% <ø> (-0.10%) ⬇️
plugins-memcached 38.20% <ø> (-0.11%) ⬇️
plugins-microgateway-core 39.44% <ø> (-0.10%) ⬇️
plugins-moleculer 40.84% <ø> (-0.10%) ⬇️
plugins-mongodb 39.55% <ø> (-0.10%) ⬇️
plugins-mongodb-core 39.13% <ø> (-0.10%) ⬇️
plugins-mongoose 39.18% <ø> (-0.10%) ⬇️
plugins-multer 23.46% <ø> (ø)
plugins-mysql 39.26% <ø> (-0.08%) ⬇️
plugins-mysql2 39.31% <ø> (-0.10%) ⬇️
plugins-node-serialize 23.73% <ø> (ø)
plugins-opensearch 37.88% <ø> (-0.10%) ⬇️
plugins-passport-http 23.56% <ø> (ø)
plugins-postgres 35.71% <ø> (-0.09%) ⬇️
plugins-process 22.88% <ø> (ø)
plugins-pug 23.69% <ø> (ø)
plugins-redis 38.95% <ø> (-0.11%) ⬇️
plugins-router 43.24% <ø> (-0.10%) ⬇️
plugins-sequelize 22.27% <ø> (ø)
plugins-test-and-upstream-amqp10 38.54% <ø> (+0.05%) ⬆️
plugins-test-and-upstream-amqplib 43.91% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-apollo 39.32% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-avsc 38.81% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-bunyan 33.86% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-connect 41.05% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-graphql 40.23% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-koa 40.63% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-protobufjs 39.05% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-rhea 44.15% <ø> (-0.10%) ⬇️
plugins-undici 39.40% <ø> (-0.10%) ⬇️
plugins-url 22.88% <ø> (ø)
plugins-valkey 38.10% <ø> (-0.14%) ⬇️
plugins-vm 22.88% <ø> (ø)
plugins-winston 34.27% <ø> (-0.10%) ⬇️
plugins-ws 42.21% <ø> (-0.10%) ⬇️
profiling-macos 40.06% <ø> (-0.10%) ⬇️
profiling-ubuntu 40.11% <ø> (-0.10%) ⬇️
profiling-windows 41.97% <ø> (+0.40%) ⬆️
serverless-azure-functions-client 22.38% <ø> (ø)
serverless-azure-functions-eventhubs 22.38% <ø> (ø)
serverless-azure-functions-servicebus 22.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fa81c20dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const meta = {
'gcloud.project_id': subscription.pubsub.projectId,
'pubsub.topic': topic,
'pubsub.message_id': message.messageId,

Choose a reason for hiding this comment

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

P2 Badge Use pull message id field instead of messageId

For pull subscriptions, the Pub/Sub Message object exposes the server-assigned ID as message.id (this was what the code used before). Switching the tag to message.messageId means the tag will be undefined for standard pull messages, so pubsub.message_id stops being recorded and downstream correlation/debugging based on message ID is lost. This regression only affects pull subscriptions where the Message instance does not include a messageId alias.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Overall package size

Self size: 4.58 MB
Deduped: 5.42 MB
No deduping: 5.42 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@pr-commenter
Copy link

pr-commenter bot commented Feb 5, 2026

Benchmarks

Benchmark execution time: 2026-02-06 22:46:09

Comparing candidate commit 085eaf6 in PR branch nina.rei/fix/add_gcp_pubsub_subscription with baseline commit e3344ae in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 229 metrics, 31 unstable metrics.

BridgeAR
BridgeAR previously approved these changes Feb 5, 2026
Copy link
Collaborator

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Please add a test

@BridgeAR BridgeAR dismissed their stale review February 5, 2026 18:44

I wanted to comment :)

Comment on lines 234 to +236
await publish(topic, { data: Buffer.from('hello') })
return expectedSpanPromise
await expectedSpanPromise
await tagsVerificationPromise
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
await publish(topic, { data: Buffer.from('hello') })
return expectedSpanPromise
await expectedSpanPromise
await tagsVerificationPromise
await Promise.all([
publish(topic, { data: Buffer.from('hello') }),
expectedSpanPromise,
tagsVerificationPromise,
])

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