{"_id":"5742d1548d72b90e000cdf24","category":{"_id":"5721f4e9dcfa860e005bef98","project":"56a1f77442dfda0d00046285","__v":0,"version":"56a1f77542dfda0d00046288","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-28T11:32:57.879Z","from_sync":false,"order":5,"slug":"partners-integrations","title":"Partners & Integrations"},"parentDoc":null,"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"},"__v":25,"project":"56a1f77442dfda0d00046285","user":"56a1f7423845200d0066d71b","updates":["5742eab334d3820e002d6daf"],"next":{"pages":[],"description":""},"createdAt":"2016-05-23T09:45:56.050Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"**Table of content**\n\n- [Integrate Heroku application with Trace](#section-integrate-a-heroku-application-with-trace)\n- [Add an another Heroku application to your Trace infrastructure](#section-add-an-another-heroku-application-to-your-trace-infrastructure)\n\n---\n\n# Integrate a Heroku application with Trace\n\nTrace provides error detection, alerting, distributed tracing and process monitoring for your Heroku applications. Installing Trace is simple with our Heroku add-on.\n\n## 1.  Ensure that all prerequisites are met\n\n- Have npm version 2.7.0 or greater installed. To update simply use `npm install npm -g`\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Be sure to use npm version greater than 2.7.0. - as Trace uses scoped packages. If you can't update to npm:::at:::2.7.0 for whatever reason, you can still install Trace using `npm i risingstack/trace-nodejs`.\",\n  \"title\": \"npm version\"\n}\n[/block]\n## 2. Install the Heroku addon\n\n### 2.1 Choose a plan that fits for your application:\n\n- **lite** (without CPU, Memory Profiling,  Distributed tracing and Security check)\n- **5-processes** (all features included)\n- **10-processes** (all features included)\n- **20-processes** (all features included)\n- **50-processes** (all features included)\n\n### 2.2./a Install add-on with the Heroku CLI\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"heroku addons:create trace:5-processes\",\n      \"language\": \"shell\",\n      \"name\": \"5-processes\"\n    },\n    {\n      \"code\": \"heroku addons:create trace:10-processes\",\n      \"language\": \"shell\",\n      \"name\": \"10-processes\"\n    },\n    {\n      \"code\": \"heroku addons:create trace:20-processes\",\n      \"language\": \"shell\",\n      \"name\": \"20-processes\"\n    },\n    {\n      \"code\": \"heroku addons:create trace:50-processes\",\n      \"language\": \"shell\",\n      \"name\": \"50-processes\"\n    },\n    {\n      \"code\": \"heroku addons:create trace:lite\",\n      \"language\": \"shell\",\n      \"name\": \"lite\"\n    }\n  ]\n}\n[/block]\n\n### 2.2./b Install Trace addon with Heroku Dashboard\n\nYou can add Trace add-on under the **Dashboard -> my-app -> Resources**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/dda7bba-heroku-provision-1.png\",\n        \"heroku-provision-1.png\",\n        1960,\n        1218,\n        \"#f3f7f7\"\n      ],\n      \"caption\": \"Provision Trace add-on to you existing Heroku app\",\n      \"border\": true,\n      \"sizing\": \"smart\"\n    }\n  ]\n}\n[/block]\nOn the next step, you can choose the plan that fits the best for your need.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/241514c-heroku-provision-2-2.png\",\n        \"heroku-provision-2-2.png\",\n        2000,\n        934,\n        \"#63636c\"\n      ],\n      \"caption\": \"Select plan and provision add-on\",\n      \"sizing\": \"smart\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\n## 2.3 Set you service name\n\n### 2.3.1./a With Heroku CLI\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"heroku config:set TRACE_SERVICE_NAME=my-web-server\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n### 2.3.2./b With Heroku Dashboard\n\nYou can also set `TRACE_SERVICE_NAME` environment variable *(config)* with the Heroku Dashboard.\n**Dashboard -> my-app -> Settings**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e3fc22a-heroku-app-config.png\",\n        \"heroku-app-config.png\",\n        1784,\n        972,\n        \"#f2f7f9\"\n      ],\n      \"caption\": \"Set `TRACE_SERVICE_NAME` config var\",\n      \"sizing\": \"smart\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Tip: Infrastructure and service (app) naming\",\n  \"body\": \"You can always rename your infrastructure.\\nFor the best practices check out our [How to name your infrastructure and services](https://trace-docs.risingstack.com/docs/how-to-name-your-infrastructure-and-services) documentation.\"\n}\n[/block]\n## 3. Install the Trace by RisingStack collector agent\n\n### 3.1. Install the collector agent as a dependency of your Node.js application using the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"npm install @risingstack/trace --save\",\n      \"language\": \"shell\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n### 3.2 Import Trace in the main script of your application. It should be the **first** module you require.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// index.js\\n\\nrequire('@risingstack/trace') // trace should be on top\\n\\n// your application code\\n\\nvar express = require('express') \\nvar app = express()\\n\\n// so on ...\",\n      \"language\": \"javascript\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n### 3.3 Deploy your application!\n\nTo deploy your application with the `heroku-cli`, run the following code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"git add --all\\ngit commit -m 'Install Trace collector agent'\\ngit push heroku master\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n### 3.4 Generate some traffic on your website.\n\n## 4. Congratulations! That's all, now you can start using Trace.\n\n- 4.1 Go to your Heroku dashboard, select the app that has the Trace add-on\n- 4.2 From the installed add-ons, click **Trace**\n- 4.3 Heroku will open Trace's website and you can start to monitor your application\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1f1b1d2-heroku-after-integration.png\",\n        \"heroku-after-integration.png\",\n        2560,\n        1226,\n        \"#ebeff3\"\n      ],\n      \"caption\": \"Successfully integrated service\"\n    }\n  ]\n}\n[/block]\nAfter generating some traffic to your application you will see how your service is communication with databases other services and external API(s) as well.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5284a91-heroku-after-integration-2.png\",\n        \"heroku-after-integration-2.png\",\n        2560,\n        1224,\n        \"#283a53\"\n      ],\n      \"caption\": \"Successfully integrated service with traffic\"\n    }\n  ]\n}\n[/block]\n\nInfrastructures with multiple services and databases looks like this:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5e24383-topology.png\",\n        \"topology.png\",\n        3360,\n        1704,\n        \"#2a4b6a\"\n      ],\n      \"caption\": \"Infrastructure with multiple services, API calls and databases\"\n    }\n  ]\n}\n[/block]\nTo add more applications to your infrastructure read the  [Add an another Heroku application to your Trace infrastructure](#section-add-an-another-heroku-application-to-your-trace-infrastructure).\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"Check out our tutorial about [how you can investigate a slow Node.js application](https://trace-docs.risingstack.com/docs/investigate-slow-nodejs-apps) with Trace By RisingStack.\",\n  \"title\": \"New in Trace?\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"What can I do if I don't see my data in Trace after 5 minutes\",\n  \"body\": \"In this case please check out our [Troubleshooting](doc:troubleshooting) guide.\\nIf you feel that you need more help, feel free to ask our Team via our in-app messenger.\"\n}\n[/block]\n---\n# Add an another Heroku application to your Trace infrastructure\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"It's a best practice to integrate your existing Trace Heroku add-on with multiple applications to see your infrastructure at one place. Trace is also able to visualize the communication between your applications and provide distributed debugging and stack traces.\",\n  \"title\": \"Multiple applications and microservices\"\n}\n[/block]\n## Add with add-on attach\n\nWith Heroku's add-on attach you can easily add more applications to your existing Trace infrastructure to unlock the full power of Trace.\n\n### 1./a Attach add-on with Heroku CLI\n\nRun the following command to attach your existing add-on to an another Heroku application.\nTo check your add-on's name run `heroku addons` first.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"heroku addons:attach my-trace-addon -a my-another-heroku-app\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Heroku add-on management\",\n  \"body\": \"Read more about Heroku add-on management: \\nhttps://devcenter.heroku.com/articles/managing-add-ons\"\n}\n[/block]\n### 1./b Attach add-on with Heroku Dashboard\n\nWith Heroku Dashboard you can easily attach your existing Trace add-on to you multiple applications yo reach the full power of our monitoring tool.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f2f0a0f-attach-add-on-1.png\",\n        \"attach-add-on-1.png\",\n        1948,\n        1190,\n        \"#f1f6f7\"\n      ],\n      \"caption\": \"Attach add-on to other Heroku applications\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\nOn the next screen, you can select the app that you would like to add to your Trace By RisingStack infrastructure.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7fcba66-attach-add-on-2.png\",\n        \"attach-add-on-2.png\",\n        1950,\n        1184,\n        \"#62626a\"\n      ],\n      \"caption\": \"Search for Heroku application to attach trace add-on\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\n### 2. Setup and install Trace By RisingStack collector agent\n\nSame as with the original add-on installation.\n\n---\n\n## Add an external application to your Trace By RisingStack Infrastructure\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Use attach for another Heroku apps\",\n  \"body\": \"For Heroku applications use the add-on attach from the previous section.\"\n}\n[/block]\n### 1. Retrieve your application's API key from your Trace add-on\n\nIt's a best practice to integrate your existing Trace Heroku add-on with multiple applications to see your infrastructure at one place. Trace is also able to visualize the communication between your applications and provide distributed debugging and stack traces.\n\nTo achieve this you have to retrieve your Trace API key from the application where you added the Trace Heroku add-on.\n\n- From Trace UI: Navigate to **Infrastructure management** from the menu and click **copy** at the right top\n- Via cli: `heroku config:get TRACE_API_KEY --app my-app-with-trace-addon`\n\n### 2. Setup your new application with Trace\n\nTo install Trace successfully for your new application, you have to pass your Trace account's environment variables in the following way:\n\n```\nheroku config:set TRACE_API_KEY=aa.bb.cc\nheroku config:set TRACE_SERVICE_NAME=my-other-application\n```\n\n### 3. Setup and install Trace By RisingStack collector agent\n\nSame as with the original add-on installation.","excerpt":"Use Trace via Heroku add-on","slug":"heroku","type":"basic","title":"Heroku"}

Heroku

Use Trace via Heroku add-on

**Table of content** - [Integrate Heroku application with Trace](#section-integrate-a-heroku-application-with-trace) - [Add an another Heroku application to your Trace infrastructure](#section-add-an-another-heroku-application-to-your-trace-infrastructure) --- # Integrate a Heroku application with Trace Trace provides error detection, alerting, distributed tracing and process monitoring for your Heroku applications. Installing Trace is simple with our Heroku add-on. ## 1. Ensure that all prerequisites are met - Have npm version 2.7.0 or greater installed. To update simply use `npm install npm -g` [block:callout] { "type": "warning", "body": "Be sure to use npm version greater than 2.7.0. - as Trace uses scoped packages. If you can't update to [email protected] for whatever reason, you can still install Trace using `npm i risingstack/trace-nodejs`.", "title": "npm version" } [/block] ## 2. Install the Heroku addon ### 2.1 Choose a plan that fits for your application: - **lite** (without CPU, Memory Profiling, Distributed tracing and Security check) - **5-processes** (all features included) - **10-processes** (all features included) - **20-processes** (all features included) - **50-processes** (all features included) ### 2.2./a Install add-on with the Heroku CLI [block:code] { "codes": [ { "code": "heroku addons:create trace:5-processes", "language": "shell", "name": "5-processes" }, { "code": "heroku addons:create trace:10-processes", "language": "shell", "name": "10-processes" }, { "code": "heroku addons:create trace:20-processes", "language": "shell", "name": "20-processes" }, { "code": "heroku addons:create trace:50-processes", "language": "shell", "name": "50-processes" }, { "code": "heroku addons:create trace:lite", "language": "shell", "name": "lite" } ] } [/block] ### 2.2./b Install Trace addon with Heroku Dashboard You can add Trace add-on under the **Dashboard -> my-app -> Resources**. [block:image] { "images": [ { "image": [ "https://files.readme.io/dda7bba-heroku-provision-1.png", "heroku-provision-1.png", 1960, 1218, "#f3f7f7" ], "caption": "Provision Trace add-on to you existing Heroku app", "border": true, "sizing": "smart" } ] } [/block] On the next step, you can choose the plan that fits the best for your need. [block:image] { "images": [ { "image": [ "https://files.readme.io/241514c-heroku-provision-2-2.png", "heroku-provision-2-2.png", 2000, 934, "#63636c" ], "caption": "Select plan and provision add-on", "sizing": "smart", "border": true } ] } [/block] ## 2.3 Set you service name ### 2.3.1./a With Heroku CLI [block:code] { "codes": [ { "code": "heroku config:set TRACE_SERVICE_NAME=my-web-server", "language": "shell" } ] } [/block] ### 2.3.2./b With Heroku Dashboard You can also set `TRACE_SERVICE_NAME` environment variable *(config)* with the Heroku Dashboard. **Dashboard -> my-app -> Settings** [block:image] { "images": [ { "image": [ "https://files.readme.io/e3fc22a-heroku-app-config.png", "heroku-app-config.png", 1784, 972, "#f2f7f9" ], "caption": "Set `TRACE_SERVICE_NAME` config var", "sizing": "smart", "border": true } ] } [/block] [block:callout] { "type": "success", "title": "Tip: Infrastructure and service (app) naming", "body": "You can always rename your infrastructure.\nFor the best practices check out our [How to name your infrastructure and services](https://trace-docs.risingstack.com/docs/how-to-name-your-infrastructure-and-services) documentation." } [/block] ## 3. Install the Trace by RisingStack collector agent ### 3.1. Install the collector agent as a dependency of your Node.js application using the following: [block:code] { "codes": [ { "code": "npm install @risingstack/trace --save", "language": "shell", "name": null } ] } [/block] ### 3.2 Import Trace in the main script of your application. It should be the **first** module you require. [block:code] { "codes": [ { "code": "// index.js\n\nrequire('@risingstack/trace') // trace should be on top\n\n// your application code\n\nvar express = require('express') \nvar app = express()\n\n// so on ...", "language": "javascript", "name": null } ] } [/block] ### 3.3 Deploy your application! To deploy your application with the `heroku-cli`, run the following code: [block:code] { "codes": [ { "code": "git add --all\ngit commit -m 'Install Trace collector agent'\ngit push heroku master", "language": "shell" } ] } [/block] ### 3.4 Generate some traffic on your website. ## 4. Congratulations! That's all, now you can start using Trace. - 4.1 Go to your Heroku dashboard, select the app that has the Trace add-on - 4.2 From the installed add-ons, click **Trace** - 4.3 Heroku will open Trace's website and you can start to monitor your application [block:image] { "images": [ { "image": [ "https://files.readme.io/1f1b1d2-heroku-after-integration.png", "heroku-after-integration.png", 2560, 1226, "#ebeff3" ], "caption": "Successfully integrated service" } ] } [/block] After generating some traffic to your application you will see how your service is communication with databases other services and external API(s) as well. [block:image] { "images": [ { "image": [ "https://files.readme.io/5284a91-heroku-after-integration-2.png", "heroku-after-integration-2.png", 2560, 1224, "#283a53" ], "caption": "Successfully integrated service with traffic" } ] } [/block] Infrastructures with multiple services and databases looks like this: [block:image] { "images": [ { "image": [ "https://files.readme.io/5e24383-topology.png", "topology.png", 3360, 1704, "#2a4b6a" ], "caption": "Infrastructure with multiple services, API calls and databases" } ] } [/block] To add more applications to your infrastructure read the [Add an another Heroku application to your Trace infrastructure](#section-add-an-another-heroku-application-to-your-trace-infrastructure). [block:callout] { "type": "success", "body": "Check out our tutorial about [how you can investigate a slow Node.js application](https://trace-docs.risingstack.com/docs/investigate-slow-nodejs-apps) with Trace By RisingStack.", "title": "New in Trace?" } [/block] [block:callout] { "type": "danger", "title": "What can I do if I don't see my data in Trace after 5 minutes", "body": "In this case please check out our [Troubleshooting](doc:troubleshooting) guide.\nIf you feel that you need more help, feel free to ask our Team via our in-app messenger." } [/block] --- # Add an another Heroku application to your Trace infrastructure [block:callout] { "type": "success", "body": "It's a best practice to integrate your existing Trace Heroku add-on with multiple applications to see your infrastructure at one place. Trace is also able to visualize the communication between your applications and provide distributed debugging and stack traces.", "title": "Multiple applications and microservices" } [/block] ## Add with add-on attach With Heroku's add-on attach you can easily add more applications to your existing Trace infrastructure to unlock the full power of Trace. ### 1./a Attach add-on with Heroku CLI Run the following command to attach your existing add-on to an another Heroku application. To check your add-on's name run `heroku addons` first. [block:code] { "codes": [ { "code": "heroku addons:attach my-trace-addon -a my-another-heroku-app", "language": "text" } ] } [/block] [block:callout] { "type": "info", "title": "Heroku add-on management", "body": "Read more about Heroku add-on management: \nhttps://devcenter.heroku.com/articles/managing-add-ons" } [/block] ### 1./b Attach add-on with Heroku Dashboard With Heroku Dashboard you can easily attach your existing Trace add-on to you multiple applications yo reach the full power of our monitoring tool. [block:image] { "images": [ { "image": [ "https://files.readme.io/f2f0a0f-attach-add-on-1.png", "attach-add-on-1.png", 1948, 1190, "#f1f6f7" ], "caption": "Attach add-on to other Heroku applications", "border": true } ] } [/block] On the next screen, you can select the app that you would like to add to your Trace By RisingStack infrastructure. [block:image] { "images": [ { "image": [ "https://files.readme.io/7fcba66-attach-add-on-2.png", "attach-add-on-2.png", 1950, 1184, "#62626a" ], "caption": "Search for Heroku application to attach trace add-on", "border": true } ] } [/block] ### 2. Setup and install Trace By RisingStack collector agent Same as with the original add-on installation. --- ## Add an external application to your Trace By RisingStack Infrastructure [block:callout] { "type": "warning", "title": "Use attach for another Heroku apps", "body": "For Heroku applications use the add-on attach from the previous section." } [/block] ### 1. Retrieve your application's API key from your Trace add-on It's a best practice to integrate your existing Trace Heroku add-on with multiple applications to see your infrastructure at one place. Trace is also able to visualize the communication between your applications and provide distributed debugging and stack traces. To achieve this you have to retrieve your Trace API key from the application where you added the Trace Heroku add-on. - From Trace UI: Navigate to **Infrastructure management** from the menu and click **copy** at the right top - Via cli: `heroku config:get TRACE_API_KEY --app my-app-with-trace-addon` ### 2. Setup your new application with Trace To install Trace successfully for your new application, you have to pass your Trace account's environment variables in the following way: ``` heroku config:set TRACE_API_KEY=aa.bb.cc heroku config:set TRACE_SERVICE_NAME=my-other-application ``` ### 3. Setup and install Trace By RisingStack collector agent Same as with the original add-on installation.