Skip to content

feat(profiler): replace sourceMapCount with hasMissingSourceMaps#7843

Merged
szegedi merged 1 commit intomasterfrom
szegedi/has-missing-source-maps
Mar 23, 2026
Merged

feat(profiler): replace sourceMapCount with hasMissingSourceMaps#7843
szegedi merged 1 commit intomasterfrom
szegedi/has-missing-source-maps

Conversation

@szegedi
Copy link
Copy Markdown
Contributor

@szegedi szegedi commented Mar 23, 2026

With this PR, we can precisely indicate whether any samples contain unmapped locations (and thus the backend should attempt server-side source mapping.) We currently have a cruder indicator, the number of source maps in the app directory, but we can now replace this with a much more precise indicator that leverages the source map handling improvements in @datadog/pprof 5.14.0.

Summary

  • Removes the sourceMapCount numeric info field from profiler metadata
  • Adds hasMissingSourceMaps boolean that is always present and reflects the value with which @datadog/pprof indicates that some samples were not mapped due to an expected source map file not being present.

Depends on DataDog/pprof-nodejs#298 and #5906.

Test plan

  • Unit tests updated: verify hasMissingSourceMaps is true when profile contains the comment token, false otherwise
  • Serverless path tested as well

🤖 Generated with Claude Code

Jira: PROF-13985

@szegedi szegedi requested a review from a team as a code owner March 23, 2026 13:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

Overall package size

Self size: 5.04 MB
Deduped: 5.88 MB
No deduping: 5.88 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@f429a85). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/dd-trace/src/profiling/profiler.js 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7843   +/-   ##
=========================================
  Coverage          ?   80.48%           
=========================================
  Files             ?      749           
  Lines             ?    32473           
  Branches          ?        0           
=========================================
  Hits              ?    26135           
  Misses            ?     6338           
  Partials          ?        0           
Flag Coverage Δ
aiguard-macos 39.15% <ø> (?)
aiguard-ubuntu 39.27% <ø> (?)
aiguard-windows 38.97% <ø> (?)
apm-capabilities-tracing-macos 48.98% <12.50%> (?)
apm-capabilities-tracing-ubuntu 49.02% <12.50%> (?)
apm-capabilities-tracing-windows 48.76% <12.50%> (?)
apm-integrations-child-process 38.49% <ø> (?)
apm-integrations-couchbase-18 37.19% <ø> (?)
apm-integrations-couchbase-eol 37.81% <ø> (?)
apm-integrations-oracledb 37.65% <ø> (?)
appsec-express 55.17% <ø> (?)
appsec-fastify 51.51% <ø> (?)
appsec-graphql 51.68% <ø> (?)
appsec-kafka 44.29% <ø> (?)
appsec-ldapjs 43.92% <ø> (?)
appsec-lodash 43.54% <ø> (?)
appsec-macos 58.18% <ø> (?)
appsec-mongodb-core 48.68% <ø> (?)
appsec-mongoose 49.34% <ø> (?)
appsec-mysql 50.78% <ø> (?)
appsec-node-serialize 43.10% <ø> (?)
appsec-passport 47.53% <ø> (?)
appsec-postgres 50.50% <ø> (?)
appsec-sourcing 42.53% <ø> (?)
appsec-template 43.26% <ø> (?)
appsec-ubuntu 58.26% <ø> (?)
appsec-windows 58.03% <ø> (?)
instrumentations-instrumentation-bluebird 32.27% <ø> (?)
instrumentations-instrumentation-body-parser 40.43% <ø> (?)
instrumentations-instrumentation-child_process 37.84% <ø> (?)
instrumentations-instrumentation-cookie-parser 34.23% <ø> (?)
instrumentations-instrumentation-express 34.55% <ø> (?)
instrumentations-instrumentation-express-mongo-sanitize 34.36% <ø> (?)
instrumentations-instrumentation-express-session 40.07% <ø> (?)
instrumentations-instrumentation-fs 31.89% <ø> (?)
instrumentations-instrumentation-generic-pool 29.46% <ø> (?)
instrumentations-instrumentation-http 39.71% <ø> (?)
instrumentations-instrumentation-knex 32.27% <ø> (?)
instrumentations-instrumentation-mongoose 33.39% <ø> (?)
instrumentations-instrumentation-multer 40.18% <ø> (?)
instrumentations-instrumentation-mysql2 38.20% <ø> (?)
instrumentations-instrumentation-passport 43.96% <ø> (?)
instrumentations-instrumentation-passport-http 43.64% <ø> (?)
instrumentations-instrumentation-passport-local 44.17% <ø> (?)
instrumentations-instrumentation-pg 37.64% <ø> (?)
instrumentations-instrumentation-promise 32.20% <ø> (?)
instrumentations-instrumentation-promise-js 32.21% <ø> (?)
instrumentations-instrumentation-q 32.25% <ø> (?)
instrumentations-instrumentation-url 32.17% <ø> (?)
instrumentations-instrumentation-when 32.22% <ø> (?)
llmobs-ai 42.16% <ø> (?)
llmobs-anthropic 40.21% <ø> (?)
llmobs-bedrock 39.15% <ø> (?)
llmobs-google-genai 39.69% <ø> (?)
llmobs-langchain 39.94% <ø> (?)
llmobs-openai 43.88% <ø> (?)
llmobs-vertex-ai 39.94% <ø> (?)
platform-core 31.47% <ø> (?)
platform-esbuild 34.42% <ø> (?)
platform-instrumentations-misc 48.41% <ø> (?)
platform-shimmer 37.56% <ø> (?)
platform-unit-guardrails 32.89% <ø> (?)
plugins-azure-durable-functions 25.74% <ø> (?)
plugins-azure-event-hubs 25.90% <ø> (?)
plugins-azure-service-bus 25.26% <ø> (?)
plugins-bullmq 44.17% <ø> (?)
plugins-cassandra 37.69% <ø> (?)
plugins-cookie 26.96% <ø> (?)
plugins-cookie-parser 26.75% <ø> (?)
plugins-crypto 26.73% <ø> (?)
plugins-dd-trace-api 38.22% <ø> (?)
plugins-express-mongo-sanitize 26.89% <ø> (?)
plugins-express-session 26.70% <ø> (?)
plugins-fastify 42.15% <ø> (?)
plugins-fetch 38.28% <ø> (?)
plugins-fs 38.55% <ø> (?)
plugins-generic-pool 25.94% <ø> (?)
plugins-google-cloud-pubsub 45.34% <ø> (?)
plugins-grpc 40.82% <ø> (?)
plugins-handlebars 26.94% <ø> (?)
plugins-hapi 40.07% <ø> (?)
plugins-hono 40.32% <ø> (?)
plugins-ioredis 38.36% <ø> (?)
plugins-knex 26.57% <ø> (?)
plugins-langgraph 38.38% <ø> (?)
plugins-ldapjs 24.43% <ø> (?)
plugins-light-my-request 26.30% <ø> (?)
plugins-limitd-client 32.55% <ø> (?)
plugins-lodash 26.03% <ø> (?)
plugins-mariadb 39.40% <ø> (?)
plugins-memcached 38.07% <ø> (?)
plugins-microgateway-core 39.14% <ø> (?)
plugins-moleculer 40.43% <ø> (?)
plugins-mongodb 39.08% <ø> (?)
plugins-mongodb-core 38.91% <ø> (?)
plugins-mongoose 38.79% <ø> (?)
plugins-multer 26.70% <ø> (?)
plugins-mysql 39.10% <ø> (?)
plugins-mysql2 39.20% <ø> (?)
plugins-node-serialize 27.00% <ø> (?)
plugins-opensearch 37.52% <ø> (?)
plugins-passport-http 26.76% <ø> (?)
plugins-postgres 35.50% <ø> (?)
plugins-process 26.73% <ø> (?)
plugins-pug 26.96% <ø> (?)
plugins-redis 38.82% <ø> (?)
plugins-router 42.87% <ø> (?)
plugins-sequelize 25.55% <ø> (?)
plugins-test-and-upstream-amqp10 38.27% <ø> (?)
plugins-test-and-upstream-amqplib 43.79% <ø> (?)
plugins-test-and-upstream-apollo 39.05% <ø> (?)
plugins-test-and-upstream-avsc 38.52% <ø> (?)
plugins-test-and-upstream-bunyan 33.80% <ø> (?)
plugins-test-and-upstream-connect 40.72% <ø> (?)
plugins-test-and-upstream-graphql 40.00% <ø> (?)
plugins-test-and-upstream-koa 40.31% <ø> (?)
plugins-test-and-upstream-protobufjs 38.74% <ø> (?)
plugins-test-and-upstream-rhea 43.96% <ø> (?)
plugins-undici 39.04% <ø> (?)
plugins-url 26.73% <ø> (?)
plugins-valkey 38.03% <ø> (?)
plugins-vm 26.73% <ø> (?)
plugins-winston 33.99% <ø> (?)
plugins-ws 41.80% <ø> (?)
profiling-macos 40.45% <ø> (?)
profiling-ubuntu 40.58% <ø> (?)
profiling-windows 42.17% <75.00%> (?)
serverless-azure-functions-client 25.62% <ø> (?)
serverless-azure-functions-eventhubs 25.62% <ø> (?)
serverless-azure-functions-servicebus 25.62% <ø> (?)

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.

@szegedi szegedi changed the base branch from master to szegedi/profiler-sync-start March 23, 2026 13:22
@szegedi szegedi changed the title profiling: replace sourceMapCount with hasMissingSourceMaps feat(profiler): replace sourceMapCount with hasMissingSourceMaps Mar 23, 2026
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 23, 2026

Benchmarks

Benchmark execution time: 2026-03-23 14:28:34

Comparing candidate commit f994206 in PR branch szegedi/has-missing-source-maps with baseline commit f429a85 in branch master.

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

IlyasShabi
IlyasShabi previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

@IlyasShabi IlyasShabi left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from szegedi/profiler-sync-start to master March 23, 2026 14:02
@szegedi szegedi dismissed IlyasShabi’s stale review March 23, 2026 14:02

The base branch was changed.

Replace the `sourceMapCount` info field with a boolean
`hasMissingSourceMaps` that checks each profile's comments for the
`dd:has-missing-map-files` token emitted by @datadog/pprof when
source files declare a sourceMappingURL but the map file is missing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@szegedi szegedi force-pushed the szegedi/has-missing-source-maps branch from 19b51b2 to f994206 Compare March 23, 2026 14:19
@szegedi
Copy link
Copy Markdown
Contributor Author

szegedi commented Mar 23, 2026

Force pushed to rebase on current master

@szegedi szegedi requested a review from IlyasShabi March 23, 2026 14:20
Copy link
Copy Markdown
Contributor

@IlyasShabi IlyasShabi left a comment

Choose a reason for hiding this comment

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

🚢

@szegedi szegedi enabled auto-merge (squash) March 23, 2026 14:24
@szegedi szegedi merged commit 031533a into master Mar 23, 2026
787 checks passed
@szegedi szegedi deleted the szegedi/has-missing-source-maps branch March 23, 2026 14:36
dd-octo-sts bot pushed a commit that referenced this pull request Mar 24, 2026
Replace the `sourceMapCount` info field with a boolean
`hasMissingSourceMaps` that checks each profile's comments for the
`dd:has-missing-map-files` token emitted by @datadog/pprof when
source files declare a sourceMappingURL but the map file is missing.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
@dd-octo-sts dd-octo-sts bot mentioned this pull request Mar 24, 2026
tlhunter pushed a commit that referenced this pull request Mar 26, 2026
Replace the `sourceMapCount` info field with a boolean
`hasMissingSourceMaps` that checks each profile's comments for the
`dd:has-missing-map-files` token emitted by @datadog/pprof when
source files declare a sourceMappingURL but the map file is missing.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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