Hi folks, This is Serkan. I am CTO & Co-Found...
# random
s
Hi folks, This is Serkan. I am CTO & Co-Founder of Thundra (thundra.io) which is tracing and debugging solution for serverless applications. In my free times I am working on some side projects and last weekend I have implemented a simple utility (
treq
) to trace module imports/requires to show you the most expensive dependencies to be imported/required during coldstart: https://github.com/serkan-ozal/treq I hope you find it useful and it help you while investigating coldstart delays. Waiting for your feedbacks. Cheers -- Serkan
t
very nice! I currently have an esbuild command I use to analyze sizes but cool to see real numbers from prod
r
Just a note - you’ll need to specify
treq
inside the nodeModules array in your bundle to make it work using the NODE_OPTIONS method
c
amazing! just tested it here just an idea, can it filter the logs by “level”? for example, instead of displaying this:
Copy code
|-- require('/Users/usr/www/ds/ail/csapi/src/handlers/faq/.build/submit-lost-order.js') took 1819.791614 ms
..|-- require('uniqid') took 10.260321 ms
..|-- require('axios') took 62.672446 ms
....|-- require('./lib/axios') took 58.076417 ms
......|-- require('./core/Axios') took 46.927798 ms
........|-- require('./dispatchRequest') took 40.297035 ms
..........|-- require('../defaults') took 32.747661 ms
............|-- require('./adapters/http') took 29.592114 ms
..............|-- require('follow-redirects') took 15.916533 ms
................|-- require('debug') took 11.55629 ms
just show this:
Copy code
|-- require('/Users/usr/www/ds/ail/csapi/src/handlers/faq/.build/submit-lost-order.js') took 1819.791614 ms
..|-- require('uniqid') took 10.260321 ms
..|-- require('axios') took 62.672446 ms
s
Hi @Carlos Daniel, good idea. Currently it only filters by duration threshold by filter by depth/level makes sense a lot 👍
I will add it soon and let you know once released
Hi @Carlos Daniel I have release
treq
new layer version
3
(
arn:aws:lambda:${region}:273094347961:layer:treq:3
) with the new
TREQ_MAX_DEPTH
configuration to limit maximum depth/level to trace nested requires/imports. FYI
c
great! I'm gonna test it