{"_id":"574e87fb491084190033738d","parentDoc":null,"project":"56a1f77442dfda0d00046285","version":{"_id":"56a1f77542dfda0d00046288","__v":9,"project":"56a1f77442dfda0d00046285","createdAt":"2016-01-22T09:33:41.397Z","releaseDate":"2016-01-22T09:33:41.397Z","categories":["56a1f77542dfda0d00046289","56a1fdf442dfda0d00046294","56a2079f0067c00d00a2f955","56a20bdf8b2e6f0d0018ea84","56a3e78a94ec0a0d00b39fed","56af19929d32e30d0006d2ce","5721f4e9dcfa860e005bef98","574e870be892bf0e004fde0d","5832fdcdb32d820f0072e12f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"56a1f912d00f7d0d00c8efd7","category":{"_id":"574e870be892bf0e004fde0d","project":"56a1f77442dfda0d00046285","version":"56a1f77542dfda0d00046288","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-06-01T06:56:11.733Z","from_sync":false,"order":2,"slug":"use-cases","title":"Use Cases"},"__v":14,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-01T07:00:11.258Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"#1 - Check your stack traces\"\n}\n[/block]\nTrace automatically collects stack traces of faulty transactions and puts them in a list on the **Traces page.**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/iymnBBDkQe6kFGa06k9C_trace-list-in-trace.png\",\n        \"trace-list-in-trace.png\",\n        \"2224\",\n        \"1074\",\n        \"#e45642\",\n        \"\"\n      ],\n      \"caption\": \"Trace list in Trace\"\n    }\n  ]\n}\n[/block]\nIf you click on an element in the list, you will get detailed information about\n* the type of the error,\n* the status code of the error,\n* the requests taking part in the faulty transaction,\n* the root request of the transaction,\n* the requestID of the transaction.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"#2 - Check the timeline graph\"\n}\n[/block]\nBy clicking on the **Timeline graph** button, you will be able to see the faulty transaction on a timeline.\n\nThis way you will get visualized information about\n* which services were taking part in that transaction,\n* how big were the response network delays,\n* how long did a service handled a request,\n* where and when the errors happened in that transaction.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/BmnFojpoTjqJ9GHbKAtZ_timeline-graph-with-error.png\",\n        \"timeline-graph-with-error.png\",\n        \"2414\",\n        \"1086\",\n        \"#1a354c\",\n        \"\"\n      ],\n      \"caption\": \"Timeline graph with error\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The red dots indicate that something went wrong during the fulfilment of the request. To get the available information on the error, **click the red dot.** A pop-up will display information about what caused the process to crash.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"#3 - Investigate the error\"\n}\n[/block]\nYou can find out the root cause of a problem by looking up the first error in a transaction and clicking on it. On the pop-up, search for the **Error information** segment of the panel.\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0zLtxD9XSH9KlXwR5QaY_detailed-error-popup.png\",\n        \"detailed-error-popup.png\",\n        \"2246\",\n        \"1012\",\n        \"#5b223c\",\n        \"\"\n      ],\n      \"caption\": \"Detailed error popup\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"You will see what caused the error, as well as the lines you have to correct.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"#4 - Fix the errors\"\n}\n[/block]\nOnce you have the line causing the error, you can start working on the fix.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"#5 - Set up alerts for downtimes\"\n}\n[/block]\nErrors resulting in a stack trace can bring down the whole process, and can cause downtimes easily. If that happens, someone on your team must be paged, using popular tools like PagerDuty or Opsgenie.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/LSVkQlE2STaEZ4uL2MAb_set-up-downtime-alerts-in-trace.png\",\n        \"set-up-downtime-alerts-in-trace.png\",\n        \"1960\",\n        \"1112\",\n        \"#eaf2f3\",\n        \"\"\n      ],\n      \"caption\": \"Set up downtime alerts in Trace\"\n    }\n  ]\n}\n[/block]\nTo set up alerts for downtimes, go to the **Alerts/Alert list page** and click the **Create a new alert** button. Under conditions select **Service downtime**, and check all the services you want to be notified via.","excerpt":"Follow these steps to stop your application crashing and to prevent further downtimes.","slug":"fix-crashing-nodejs-applications-with-trace","type":"basic","title":"Fix crashing Node.js apps"}

Fix crashing Node.js apps

Follow these steps to stop your application crashing and to prevent further downtimes.

[block:api-header] { "type": "basic", "title": "#1 - Check your stack traces" } [/block] Trace automatically collects stack traces of faulty transactions and puts them in a list on the **Traces page.** [block:image] { "images": [ { "image": [ "https://files.readme.io/iymnBBDkQe6kFGa06k9C_trace-list-in-trace.png", "trace-list-in-trace.png", "2224", "1074", "#e45642", "" ], "caption": "Trace list in Trace" } ] } [/block] If you click on an element in the list, you will get detailed information about * the type of the error, * the status code of the error, * the requests taking part in the faulty transaction, * the root request of the transaction, * the requestID of the transaction. [block:api-header] { "type": "basic", "title": "#2 - Check the timeline graph" } [/block] By clicking on the **Timeline graph** button, you will be able to see the faulty transaction on a timeline. This way you will get visualized information about * which services were taking part in that transaction, * how big were the response network delays, * how long did a service handled a request, * where and when the errors happened in that transaction. [block:image] { "images": [ { "image": [ "https://files.readme.io/BmnFojpoTjqJ9GHbKAtZ_timeline-graph-with-error.png", "timeline-graph-with-error.png", "2414", "1086", "#1a354c", "" ], "caption": "Timeline graph with error" } ] } [/block] [block:callout] { "type": "info", "body": "The red dots indicate that something went wrong during the fulfilment of the request. To get the available information on the error, **click the red dot.** A pop-up will display information about what caused the process to crash." } [/block] [block:api-header] { "type": "basic", "title": "#3 - Investigate the error" } [/block] You can find out the root cause of a problem by looking up the first error in a transaction and clicking on it. On the pop-up, search for the **Error information** segment of the panel. [block:image] { "images": [ { "image": [ "https://files.readme.io/0zLtxD9XSH9KlXwR5QaY_detailed-error-popup.png", "detailed-error-popup.png", "2246", "1012", "#5b223c", "" ], "caption": "Detailed error popup" } ] } [/block] [block:callout] { "type": "info", "body": "You will see what caused the error, as well as the lines you have to correct." } [/block] [block:api-header] { "type": "basic", "title": "#4 - Fix the errors" } [/block] Once you have the line causing the error, you can start working on the fix. [block:api-header] { "type": "basic", "title": "#5 - Set up alerts for downtimes" } [/block] Errors resulting in a stack trace can bring down the whole process, and can cause downtimes easily. If that happens, someone on your team must be paged, using popular tools like PagerDuty or Opsgenie. [block:image] { "images": [ { "image": [ "https://files.readme.io/LSVkQlE2STaEZ4uL2MAb_set-up-downtime-alerts-in-trace.png", "set-up-downtime-alerts-in-trace.png", "1960", "1112", "#eaf2f3", "" ], "caption": "Set up downtime alerts in Trace" } ] } [/block] To set up alerts for downtimes, go to the **Alerts/Alert list page** and click the **Create a new alert** button. Under conditions select **Service downtime**, and check all the services you want to be notified via.