Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

feat: use souce-map-support wrapCallSite to apply source maps to call stacks#1015

Merged
kjin merged 1 commit intogoogleapis:masterfrom
two-chairs:source-map-support
May 3, 2019
Merged

feat: use souce-map-support wrapCallSite to apply source maps to call stacks#1015
kjin merged 1 commit intogoogleapis:masterfrom
two-chairs:source-map-support

Conversation

@AaronFriel
Copy link
Copy Markdown
Contributor

This produces nice call stacks that display line and column numbers from transpiled TypeScript, Coffee Script, etc source files like this:

Callstack
runInSpan (/app/src/trace-util.ts:129:30)
runDispatcherInTrace [as runDispatcherInTrace] (/app/src/trace-util.ts:167:18)
source.asCallback (/app/src/dispatcher/simpleDispatcher.ts:57:29)
dispatchMessage (/app/src/source/natsSource.ts:141:9)
trace_util_1.runInSpan (/app/src/source/natsSource.ts:74:19)
that.runWithContext (/app/node_modules/@google-cloud/trace-agent/build/src/cls/async-hooks.js:143:49)
runWithContext [as runWithContext] (/app/node_modules/@google-cloud/trace-agent/build/src/cls/async-hooks.js:121:20)
contextWrapper (/app/node_modules/@google-cloud/trace-agent/build/src/cls/async-hooks.js:143:25)
tracing_1.tracer.runInRootSpan (/app/src/trace-util.ts:144:17)
cls_1.cls.get.runWithContext (/app/node_modules/@google-cloud/trace-agent/build/src/trace-api.js:193:20)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 3, 2019
@AaronFriel AaronFriel changed the title feat: use builtin Error.prepareStackTrace to preserve source mapping overrides feat: use souce-map-support wrapCallSite to apply source maps to call stacks May 3, 2019
@kjin kjin self-requested a review May 3, 2019 19:11
@AaronFriel AaronFriel force-pushed the source-map-support branch from d7f4b90 to f01268d Compare May 3, 2019 19:13
Copy link
Copy Markdown
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR!

I'm going to tack on a simple test if you don't mind, so please let me know when the changes in a stable state.

@kjin
Copy link
Copy Markdown
Contributor

kjin commented May 3, 2019

Landing this w/ a follow-up PR for tests.

@kjin kjin merged commit c558455 into googleapis:master May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants