Repository navigation
o11y POC for Express - #13963
Merged
Merged
o11y POC for Express#13963
Conversation
🦋 Changeset detectedLatest commit: 795704b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Contributor
🧪 Test StrategyComparing: Strategy: Infrastructure changes detected - running ALL tests Affected packages (30): All packages will be tested Includes:
E2E Tests: All e2e tests will run This comment is automatically generated based on the affected testing strategy |
jeffsee55
enabled auto-merge (squash)
September 22, 2025 22:34
onsclom
approved these changes
Sep 23, 2025
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Merged
jeffsee55
pushed a commit
that referenced
this pull request
Sep 23, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - Add experimental o11y support for express when `VERCEL_EXPERIMENTAL_EXPRESS_BUILD=1` ([#13963](#13963)) - Updated dependencies \[[`353eca54fe2a892ca04fa66a1665d89d7a722a7a`](353eca5)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Add experimental o11y support for express when `VERCEL_EXPERIMENTAL_EXPRESS_BUILD=1` ([#13963](#13963)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for an experimental builder that does app introspection on the Express instance. It can used with an env var
VERCEL_EXPERIMENTAL_EXPRESS_BUILD=1. It provides route-level o11y so when you're looking at your logs you can see the routes servedKey differences:
@vercel/nodebuilder. Usesrolldowninstead.node_modulesaside from using NFT for them, as we do in the node builder.@vercel/nodelogic sufficiently and starting from scratch is a bit easier for now. And it had some wins overesbuildfor being able to avoid bundling.@/my-libor imports with missing file extensions, but running it against the compiled code seems to work nicely.writeBuildResult.@vercel/expresspackage currently uses version 3vc devat the moment. Usesrvx!Explanation
The gist of the POC is that we need to extract info from the express instance, so we compile the source code, monkey-patch express with a wrapper function that exports the app's metadata, invoke the code with a child process and then use the metadata add routes to the build output and then clean up the monkey-patch code.
NOTE: the introspection logic is basic, it doesn't process sub-routes. There's some work to the Express router that will make this easier for v5, and for v4 the logic will look different but AFAIK it's easier to do there.
Before we can really use this as the main path forward
We need to validate this approach, it's kind of a hack but does give us some nice improvements. The change to using rolldown is arguably not necessary, we might want to continue to use the node builder logic to reduce friction.