Skip to content

feat(supabase): add tracing integration - #9812

Draft
crysmags wants to merge 3 commits into
masterfrom
crysmags/supabase-integration
Draft

feat(supabase): add tracing integration#9812
crysmags wants to merge 3 commits into
masterfrom
crysmags/supabase-integration

Conversation

@crysmags

Copy link
Copy Markdown
Collaborator

Note: This PR was generated with the APM Instrumentation Toolkit.

What does this PR do?

Adds automatic tracing for the Supabase JavaScript client and its delegated packages:

  • Auth (GoTrueClient.getUser)
  • Edge Functions (FunctionsClient.invoke)
  • PostgREST database operations (PostgrestBuilder.then)
  • Realtime messaging (RealtimeChannel.send)
  • Storage (StorageBucketApi.listBuckets and authenticated storage fetches)

The integration uses Orchestrion-generated CJS/ESM hooks and a conventional composite dd-trace plugin. Supabase spans use the active context, so serverless applications preserve their AWS Lambda, Azure Functions, or other platform invocation root.

This also adds plugin registration, configuration, supported-version metadata, API docs, and a focused CI job.

Motivation

Serverless applications commonly use Supabase for database, auth, storage, realtime, and function calls. Instrumenting these operations as child spans gives users end-to-end visibility beneath the platform-owned invocation root without adding a separate serverless tracing architecture or changing application return and flush behavior.

Additional Notes

This is a draft for maintainer review of the generated instrumentation points, naming, and test coverage.

Verification completed by the workflow:

  • Focused local plugin suite: 34 passing tests for @supabase/supabase-js@2.112.2
  • CJS and ESM hook loading
  • FakeAgent delivery, direct child parenting, errors, timeouts, exactly-once finish, and behavior preservation
  • Deployed AWS Lambda probe: 14 normal, error, timeout, long-running, and burst invocations; one platform-owned root and six Supabase child spans; temporary resources removed

The local lint command is currently blocked by a pre-existing dependency mismatch in the reused worktree (eslint-plugin-unicorn does not provide iteration-fallback-style).

Agent session

bin/dd-apm serverless-native '@supabase/supabase-js' --runner codex --model openai/gpt-5.6-sol

Generated with APM Instrumentation Toolkit

@crysmags crysmags added ai-generated PR created with AI assistance apm-integration-toolkit PR Generated by APM AI Integration Toolkit labels Aug 13, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.22 MB
Deduped: 8.88 MB
No deduping: 8.88 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 441.72 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

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

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 13, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 98.54% (+0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 68533dd | Docs | Datadog PR Page | Give us feedback!

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.53%. Comparing base (119f680) to head (68533dd).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9812      +/-   ##
==========================================
+ Coverage   98.52%   98.53%   +0.01%     
==========================================
  Files         975      986      +11     
  Lines      142737   144749    +2012     
  Branches    12717    12783      +66     
==========================================
+ Hits       140628   142632    +2004     
- Misses       2109     2117       +8     
Flag Coverage Δ
aiguard 57.40% <100.00%> (-0.08%) ⬇️
aiguard-integration 55.64% <100.00%> (-0.04%) ⬇️
apm-bucket-0 57.80% <100.00%> (+0.83%) ⬆️
apm-bucket-1 62.95% <100.00%> (-0.12%) ⬇️
apm-bucket-2 61.79% <100.00%> (-0.12%) ⬇️
apm-bucket-3 59.43% <100.00%> (-0.10%) ⬇️
apm-capabilities-tracing 62.32% <56.62%> (-0.16%) ⬇️
apm-integrations-aerospike 55.69% <100.00%> (-0.12%) ⬇️
apm-integrations-confluentinc-kafka-javascript 60.79% <100.00%> (-0.11%) ⬇️
apm-integrations-couchbase 56.39% <100.00%> (-0.07%) ⬇️
apm-integrations-http 61.52% <100.00%> (-0.11%) ⬇️
apm-integrations-kafkajs 61.30% <100.00%> (-0.11%) ⬇️
apm-integrations-next 59.04% <100.00%> (-0.09%) ⬇️
apm-integrations-prisma 58.48% <100.00%> (+0.21%) ⬆️
appsec 71.61% <100.00%> (-0.16%) ⬇️
appsec-express_fastify_graphql 69.00% <100.00%> (-0.14%) ⬇️
appsec-integration 49.71% <100.00%> (-0.16%) ⬇️
appsec-kafka_ldapjs_lodash 63.01% <100.00%> (-0.12%) ⬇️
appsec-mongodb-core_mongoose_mysql 66.47% <100.00%> (-0.13%) ⬇️
appsec-next 56.39% <100.00%> (-0.06%) ⬇️
appsec-node-serialize_passport_postgres 65.88% <100.00%> (-0.13%) ⬇️
appsec-sourcing_stripe_template 64.33% <100.00%> (-0.12%) ⬇️
debugger 63.83% <100.00%> (-0.11%) ⬇️
instrumentations-bucket-0 51.44% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-1 59.29% <100.00%> (-0.10%) ⬇️
instrumentations-bucket-10 60.53% <100.00%> (-0.10%) ⬇️
instrumentations-bucket-11 61.18% <100.00%> (-0.10%) ⬇️
instrumentations-bucket-12 51.35% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-13 52.19% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-14 51.46% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-2 52.67% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-3 53.31% <100.00%> (-0.04%) ⬇️
instrumentations-bucket-4 58.37% <100.00%> (-0.09%) ⬇️
instrumentations-bucket-5 49.00% <100.00%> (-0.23%) ⬇️
instrumentations-bucket-6 59.89% <100.00%> (-0.10%) ⬇️
instrumentations-bucket-7 51.64% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-8 58.07% <100.00%> (-0.08%) ⬇️
instrumentations-bucket-9 56.92% <100.00%> (-0.07%) ⬇️
instrumentations-instrumentation-couchbase 50.43% <100.00%> (-0.07%) ⬇️
instrumentations-integration-esbuild 34.07% <100.00%> (+0.18%) ⬆️
llmobs-ai_anthropic_bedrock 62.43% <100.00%> (-0.17%) ⬇️
llmobs-bucket-1 60.96% <100.00%> (-0.15%) ⬇️
llmobs-openai 61.38% <100.00%> (-0.10%) ⬇️
llmobs-openai-agents_vertex-ai 59.70% <100.00%> (-0.09%) ⬇️
llmobs-sdk 67.36% <100.00%> (+0.29%) ⬆️
master-coverage 98.53% <100.00%> (?)
openfeature 55.36% <100.00%> (-0.04%) ⬇️
openfeature-unit 53.03% <100.00%> (-0.04%) ⬇️
platform-core_esbuild_instrumentations-misc 40.99% <100.00%> (-0.04%) ⬇️
platform-integration 60.06% <100.00%> (-0.08%) ⬇️
platform-shimmer_unit-guardrails_webpack 38.65% <100.00%> (+<0.01%) ⬆️
plugins-bucket-0 56.58% <100.00%> (-0.12%) ⬇️
plugins-bucket-1 53.73% <100.00%> (-0.03%) ⬇️
plugins-bucket-11 61.08% <100.00%> (-0.11%) ⬇️
plugins-bucket-17 ?
plugins-bucket-18 61.09% <100.00%> (-0.57%) ⬇️
plugins-bucket-19 59.34% <100.00%> (-1.69%) ⬇️
plugins-bucket-20 61.25% <100.00%> (-2.17%) ⬇️
plugins-bucket-4 57.97% <100.00%> (-0.08%) ⬇️
plugins-bullmq_cassandra_cookie 60.98% <100.00%> (-0.11%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 56.04% <100.00%> (-0.07%) ⬇️
plugins-fetch_fs_generic-pool 57.92% <100.00%> (-0.04%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 63.72% <100.00%> (-0.13%) ⬇️
plugins-hapi_hono_ioredis 59.53% <100.00%> (-0.10%) ⬇️
plugins-knex_langgraph_ldapjs 54.78% <100.00%> (-0.05%) ⬇️
plugins-light-my-request_limitd-client_lodash 58.03% <100.00%> (-0.09%) ⬇️
plugins-mariadb_memcached_mercurius 61.16% <100.00%> (+0.13%) ⬆️
plugins-mongodb_mongodb-core_mongoose 58.90% <100.00%> (-0.09%) ⬇️
plugins-multer_mysql_mysql2 58.50% <100.00%> (-0.08%) ⬇️
plugins-nats_node-serialize_opensearch 60.01% <100.00%> (-0.10%) ⬇️
plugins-passport-http_pino_postgres 58.25% <100.00%> (-0.08%) ⬇️
plugins-process_pug_redis 57.06% <100.00%> (-0.08%) ⬇️
plugins-router_sequelize_supabase 60.70% <100.00%> (?)
plugins-test-and-upstream-rhea_undici_url 60.70% <100.00%> (?)
plugins-undici_url_valkey ?
plugins-valkey_vm_winston 57.35% <100.00%> (?)
plugins-vm_winston_ws ?
plugins-ws 58.90% <100.00%> (?)
profiling 61.30% <100.00%> (-0.11%) ⬇️
serverless-aws-sdk-aws-sdk 54.55% <100.00%> (-0.38%) ⬇️
serverless-aws-sdk-base-inject-field 50.68% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-bedrockruntime 54.35% <100.00%> (-0.10%) ⬇️
serverless-aws-sdk-client 55.87% <100.00%> (-0.12%) ⬇️
serverless-aws-sdk-dynamodb 55.17% <100.00%> (-0.12%) ⬇️
serverless-aws-sdk-eventbridge 56.63% <100.00%> (+7.10%) ⬆️
serverless-aws-sdk-kinesis 58.69% <100.00%> (-0.14%) ⬇️
serverless-aws-sdk-lambda 56.88% <100.00%> (-0.13%) ⬇️
serverless-aws-sdk-s3 55.27% <100.00%> (-0.11%) ⬇️
serverless-aws-sdk-serverless-peer-service 59.27% <100.00%> (+0.19%) ⬆️
serverless-aws-sdk-sns 59.48% <100.00%> (-0.15%) ⬇️
serverless-aws-sdk-sqs 59.89% <100.00%> (-0.15%) ⬇️
serverless-aws-sdk-stepfunctions 55.10% <100.00%> (-0.11%) ⬇️
serverless-aws-sdk-util 51.20% <100.00%> (-0.02%) ⬇️
serverless-bucket-0 53.53% <100.00%> (-0.08%) ⬇️
serverless-bucket-1 58.51% <100.00%> (-0.09%) ⬇️
test-optimization-cucumber 70.68% <100.00%> (-0.29%) ⬇️
test-optimization-cypress 64.86% <100.00%> (-0.11%) ⬇️
test-optimization-jest 72.07% <100.00%> (-0.30%) ⬇️
test-optimization-mocha 72.13% <100.00%> (+0.25%) ⬆️
test-optimization-playwright-playwright-atr 59.65% <100.00%> (-0.11%) ⬇️
test-optimization-playwright-playwright-efd 59.80% <100.00%> (-0.10%) ⬇️
test-optimization-playwright-playwright-final-status 59.95% <100.00%> (-0.12%) ⬇️
test-optimization-playwright-playwright-impacted-tests 59.51% <100.00%> (+0.04%) ⬆️
test-optimization-playwright-playwright-reporting 60.98% <100.00%> (-0.18%) ⬇️
test-optimization-playwright-playwright-test-management 60.44% <100.00%> (-0.22%) ⬇️
test-optimization-playwright-playwright-test-span 59.69% <100.00%> (-0.17%) ⬇️
test-optimization-selenium 58.89% <100.00%> (-0.22%) ⬇️
test-optimization-testopt 57.54% <100.00%> (+0.04%) ⬆️
test-optimization-vitest 72.77% <100.00%> (-0.29%) ⬇️
test-optimization-vitest-browser 58.73% <100.00%> (-0.08%) ⬇️
test-optimization-webdriverio 65.02% <100.00%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@pr-commenter

pr-commenter Bot commented Aug 13, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-14 16:21:33

Comparing candidate commit 68533dd in PR branch crysmags/supabase-integration with baseline commit 119f680 in branch master.

📊 Benchmarking dashboard

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-212.592ms; +195.058ms] or [-7.835%; +7.189%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-197.318ms; +263.163ms] or [-7.592%; +10.126%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-170.259ms; +161.204ms] or [-5.435%; +5.146%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-186.534ms; +193.739ms] or [-6.325%; +6.569%]

scenario:appsec-control-20

  • unstable execution_time [-110.864ms; +131.543ms] or [-6.648%; +7.888%]

scenario:appsec-control-24

  • unstable execution_time [-119.213ms; +117.179ms] or [-9.424%; +9.263%]

scenario:appsec-control-26

  • unstable execution_time [-125.804ms; +137.943ms] or [-9.936%; +10.895%]

scenario:appsec-iast-no-vulnerability-control-20

  • unstable execution_time [-15791.193µs; +15572.793µs] or [-6.036%; +5.953%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-10.902ms; +16.407ms] or [-4.200%; +6.321%]

scenario:debugger-line-probe-with-snapshot-default-20

  • unstable cpu_user_time [-59.683s; +65.757s] or [-160.601%; +176.945%]
  • unstable execution_time [-76.023s; +83.802s] or [-170.098%; +187.503%]
  • unstable instructions [-224.3G instructions; +246.9G instructions] or [-113.456%; +124.894%]
  • unstable max_rss_usage [-62.812MB; +65.884MB] or [-32.762%; +34.365%]
  • unstable throughput [-1016.901op/s; +1024.843op/s] or [-52.491%; +52.901%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-30.390s; +9.877s] or [-127.289%; +41.371%]
  • unstable execution_time [-39.669s; +12.896s] or [-142.119%; +46.202%]
  • unstable instructions [-90.6G instructions; +29.6G instructions] or [-65.868%; +21.511%]
  • unstable max_rss_usage [-78.636MB; +26.870MB] or [-36.587%; +12.502%]
  • unstable throughput [-195.694op/s; +587.633op/s] or [-9.734%; +29.229%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-28.786s; +45.175s] or [-131.828%; +206.884%]
  • unstable execution_time [-37.378s; +58.780s] or [-148.023%; +232.777%]
  • unstable instructions [-93.8G instructions; +143.8G instructions] or [-68.770%; +105.350%]
  • unstable max_rss_usage [-70.994MB; +113.423MB] or [-33.762%; +53.940%]
  • unstable throughput [-1196.742op/s; +873.184op/s] or [-56.949%; +41.552%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-13.200s; +21.485s] or [-79.289%; +129.058%]
  • unstable execution_time [-17.009s; +27.570s] or [-91.506%; +148.326%]
  • unstable instructions [-35.1G instructions; +64.7G instructions] or [-31.079%; +57.232%]
  • unstable max_rss_usage [-69.951MB; +113.352MB] or [-36.023%; +58.373%]
  • unstable throughput [-1041.919op/s; +590.920op/s] or [-47.459%; +26.916%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-10.716s; +4.264s] or [-62.033%; +24.684%]
  • unstable execution_time [-13.223s; +5.118s] or [-69.770%; +27.001%]
  • unstable instructions [-29.9G instructions; +17.1G instructions] or [-24.196%; +13.817%]
  • unstable max_rss_usage [-63.767MB; +23.165MB] or [-32.650%; +11.861%]
  • unstable throughput [-359.759op/s; +455.471op/s] or [-17.087%; +21.632%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable instructions [-15.8G instructions; +18.8G instructions] or [-9.150%; +10.938%]
  • unstable max_rss_usage [-17.993MB; +24.277MB] or [-4.822%; +6.506%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-3050.868ms; +2032.610ms] or [-6.944%; +4.627%]
  • unstable execution_time [-3177.142ms; +2199.803ms] or [-6.107%; +4.228%]
  • unstable instructions [-28.2G instructions; +17.6G instructions] or [-14.229%; +8.858%]
  • unstable throughput [-26.198op/s; +37.979op/s] or [-4.246%; +6.156%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-447.753ms; +223.983ms] or [-9.252%; +4.628%]
  • unstable execution_time [-450.063ms; +227.401ms] or [-9.159%; +4.628%]
  • unstable throughput [-83321.549op/s; +156704.943op/s] or [-4.872%; +9.163%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-24

  • unstable cpu_usage_percentage [-4.441%; +5.727%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-25.794MB; +30.426MB] or [-6.517%; +7.687%]

scenario:plugin-pg-service-26

  • unstable cpu_usage_percentage [-11.123%; +6.938%]
  • unstable execution_time [-99.408ms; +176.437ms] or [-10.773%; +19.121%]
  • unstable throughput [-807445.172op/s; +430560.093op/s] or [-12.141%; +6.474%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated PR created with AI assistance apm-integration-toolkit PR Generated by APM AI Integration Toolkit semver-minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant