0

I am using Google App Engine to run my NodeJS app on flexible env, now i wanted to generate FlameGraph but the thing is as App Engine itself handle scaling and deploying of instances now can anyone please tell me how can i generate Flamegraph(NodeJs Profiling) to trace Requests coming on my NodeJs server.

If anyone of you has worked on Google App Engine on any Framework(NodeJs or any other), Can you all please tell me how did you solve this kind of problem on App Engine.

Update -

Why We need to delete the instance after debugging it.

enter image description here

Sudhanshu Gaur
  • 7,486
  • 9
  • 47
  • 94

1 Answers1

3

Flame graphs are a visualization of profiled software, allowing the most frequent code-paths to be identified quickly and accurately.

So FlameGraphs have nothing to do with networking, scaling or deploying to GCP.

Anyhow, FlameGraph is a just a 3rd party tool you can install and run. So the answer is you can make it work same way you would install and run on your local computer.

If you don't know how to use FlameGraph to profile NodeJS, then you should start reading some tutorials, as this site is not for that type of questions. A good one is here: https://nodejs.org/en/blog/uncategorized/profiling-node-js/

UPDATE: How to ssh into app engine flex instance

In google cloud console go to App Engine Flex -> Instances

enter image description here

Caner
  • 57,267
  • 35
  • 174
  • 180
  • But the thing is on `App Engine` the instances are managed by App Engine, So how can i run anything on them ?? – Sudhanshu Gaur Apr 03 '18 at 14:15
  • In app engine flex you can modify the environment using docker files, see: https://cloud.google.com/appengine/docs/the-appengine-environments – Caner Apr 03 '18 at 14:28
  • Also if it is a standalone library you can just add it to your project folder. See this for more info: https://stackoverflow.com/questions/14850853/how-to-include-third-party-python-libraries-in-google-app-engine – Caner Apr 03 '18 at 14:39
  • Sorry if I don't understand you correctly but FlameGraph is made by running command through console on my instance. But the thing here is, how can I run the command on my app engine instances ?? I am kind of confused in using App Engine. – Sudhanshu Gaur Apr 03 '18 at 20:57
  • @SudhanshuGaur see the update to the answer. You should really study the basics of app engine environment – Caner Apr 03 '18 at 21:46
  • Yes i know i can SSH through it but the problem is after debugging then i will have to delete that VM instance, that's why i was trying to avoid it. – Sudhanshu Gaur Apr 03 '18 at 21:50
  • why do you need to delete after debugging? – Caner Apr 03 '18 at 21:52
  • Ok, I see your point. Why don't you use Flamegraph locally? As far as I understood, it is a tool for finding where your program spends most of time. You can debug locally and put your final app to the cloud. See https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server – Caner Apr 03 '18 at 23:52