[SVLS-7168] Create GCP PubSub Push Subscriptions Plugin#6260
Conversation
Overall package sizeSelf size: 4.39 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6260 +/- ##
==========================================
- Coverage 84.77% 84.49% -0.29%
==========================================
Files 522 523 +1
Lines 22233 22445 +212
==========================================
+ Hits 18849 18964 +115
- Misses 3384 3481 +97 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2025-12-20 19:33:31 Comparing candidate commit 89ad695 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 288 metrics, 30 unstable metrics. scenario:plugin-http-server-querystring-obfuscation-22
scenario:plugin-http-server-querystring-obfuscation-24
|
BridgeAR
left a comment
There was a problem hiding this comment.
This is quite a big PR, if you like, we could set up a sync call to go through the changes to review the PR :)
|
1d06808 to
df5b0e9
Compare
b596491 to
5a13644
Compare
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
6b7abdb to
d237c98
Compare
a15deff to
89ae84f
Compare
426a3af to
4efa08d
Compare
4efa08d to
89ad695
Compare
* Add plugin for GCP PubSub Push Subscriptions * feat: add producer-side batch message handling with span linking * feat: add span linking from delivery span to pubsub.request * feat: add span linking and batch metadata to pull-based consumer - Collect span links from messages 2-N (first becomes parent) - Extract parent context from first message trace context - Create pubsub.request span with span links metadata - Inject batch metadata into all messages (_dd.pubsub_request.*, _dd.batch.*) - Add 128-bit trace ID support (_dd.p.tid) - Add operation tag for batched vs single requests - HTTP plugin now checks if a delivery span is active in storage - If found, uses delivery span as parent for http.request - Ensures proper span hierarchy for push subscriptions - Extract pubsub.request span ID from message attributes - Add span link correlation tags - Calculate delivery duration from publish start time - Add batch size and index tags for batched messages
* Add plugin for GCP PubSub Push Subscriptions * feat: add producer-side batch message handling with span linking * feat: add span linking from delivery span to pubsub.request * feat: add span linking and batch metadata to pull-based consumer - Collect span links from messages 2-N (first becomes parent) - Extract parent context from first message trace context - Create pubsub.request span with span links metadata - Inject batch metadata into all messages (_dd.pubsub_request.*, _dd.batch.*) - Add 128-bit trace ID support (_dd.p.tid) - Add operation tag for batched vs single requests - HTTP plugin now checks if a delivery span is active in storage - If found, uses delivery span as parent for http.request - Ensures proper span hierarchy for push subscriptions - Extract pubsub.request span ID from message attributes - Add span link correlation tags - Calculate delivery duration from publish start time - Add batch size and index tags for batched messages
What does this PR do?
This PR adds comprehensive support for Google Cloud Pub/Sub push subscriptions, enabling distributed tracing for messages delivered via HTTP webhooks. Unlike pull subscriptions, where the application pulls for messages using the SDK, push subscriptions have GCP Pub/Sub POST messages directly to an HTTP endpoint.
New Plugin:
pubsub-push-subscription.jsModified:
packages/datadog-instrumentations/src/http.jsapm:http:server:request:startbefore the HTTP server pluginNext PR in the batch is #6782
Motivation
An inferred span for the push subscription HTTP POST request to the Cloud Run service from a pub/sub topic
Example full Push Distributed Trace of a cloud run service triggering another service using a push subscription
Plugin Checklist
Additional Notes
Critical for Distributed Tracing: When creating or updating a GCP Pub/Sub push subscription, you must include the
--push-no-wrapper-write-metadataflag to enable trace context propagation. By default, GCP Pub/Sub wraps push messages in a JSON envelope and does not include message attributes as HTTP headers. We do not currently read thereq.bodyfor pubsub distributed tracingAdditional information can be found in this doc