{"_id":"578e63c12be36c0e00f1fade","project":"56a1f77442dfda0d00046285","parentDoc":null,"user":"56a1f7423845200d0066d71b","category":{"_id":"56a3e78a94ec0a0d00b39fed","pages":["56a3e79b5e57f20d000eae83","56a3e7c2545bc50d000e3abf","56a3e7da5fb2530d00421b5a","56a9fee32bb3910d000ee9ba","56aa2f502bb3910d000eea00","56aa38f6befafb1900044ccf","56aa38fa2bb3910d000eea0e"],"project":"56a1f77442dfda0d00046285","version":"56a1f77542dfda0d00046288","__v":7,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-23T20:50:18.363Z","from_sync":false,"order":0,"slug":"nodejs","title":"Node.js Monitoring"},"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":5,"updates":["58aed9242470660f00b54495"],"next":{"pages":[],"description":""},"createdAt":"2016-07-19T17:30:41.156Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"Deployment web hook provides a simple way to mark new deployments in Trace and find out how they affect your application.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e3a54ac-deployhook.png\",\n        \"deployhook.png\",\n        1095,\n        425,\n        \"#3d8bc3\"\n      ],\n      \"caption\": \"Deployhooks helps to find differences by releases\",\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\n## Setup\n\nYou can set up the webhook in your Continuous Delivery platform in a way that it sends data every time a new deployment happens.\n\nThis way new deployments will be marked on the metrics chart automatically.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"For your personal api-key visit your infrastructure settings in Trace, where you can find a helpful wizard to setup deploy hooks.\",\n  \"title\": \"API Key\"\n}\n[/block]\n### Setup via trace-cli\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"trace-cli deployhook --git   \\\\\\n  --service-name=\\\"my service\\\"   \\\\  \\n  --api-key=\\\"your-trace-api-key\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nFor the non GIT specific options check out the [trace-cli docs](https://github.com/risingstack/trace-cli).\n\n### Setup via cURL\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl \\\"https://api.trace.risingstack.com/service/${TRACE_SERVICE_NAME}/deployment\\\"  \\\\\\n  -X POST  \\\\\\n  -H 'Content-Type: application/json'  \\\\\\n  -H \\\"Authorization: Bearer ${TRACE_API_KEY}\\\"  \\\\\\n  -d '{\\n    \\\"revision\\\": \\\"'$(git rev-parse HEAD)'\\\",\\n    \\\"description\\\": \\\"My deploy\\\",\\n    \\\"user\\\": \\\"'$(whoami)'\\\"\\n  }''\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n### Setup with CircleCI\n\nSet your `TRACE_API_KEY` and `TRACE_SERVICE_NAME` as environment variables.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"machine:\\n  node:\\n    version: 4.4.4\\ntest:\\n  pre:\\n    - npm install\\n    - npm i -g :::at:::risingstack/trace-cli\\n  override:\\n    - npm test\\ndeployment:\\n  staging:\\n    branch: master\\n    commands:\\n\\t    - your-deploy-script\\n      - trace-cli deployhook —-git\",\n      \"language\": \"yaml\",\n      \"name\": \"circlecI.yaml\"\n    }\n  ]\n}\n[/block]\n### Setup with Heroku Post Hook\n\nUse the UI wizard to retrieve your webhook URL: **Settings > Integration Status > Setup a deploy webhook > Heroku**\n\n1. Add Deploy Hooks addon\n2. Provision the HTTP Post Hook type\n3. Set URL to the one from the wizard\n\n### Setup via UI\n\nIt's possible to use our wizard to setup deployment webhooks.\nYou can find it in the **Settings > Integration Status > Setup a deploy webhook**","excerpt":"Mark deploys in Trace","slug":"deployment-hook","type":"basic","title":"Deployment hook"}

Deployment hook

Mark deploys in Trace

Deployment web hook provides a simple way to mark new deployments in Trace and find out how they affect your application. [block:image] { "images": [ { "image": [ "https://files.readme.io/e3a54ac-deployhook.png", "deployhook.png", 1095, 425, "#3d8bc3" ], "caption": "Deployhooks helps to find differences by releases", "sizing": "80" } ] } [/block] ## Setup You can set up the webhook in your Continuous Delivery platform in a way that it sends data every time a new deployment happens. This way new deployments will be marked on the metrics chart automatically. [block:callout] { "type": "info", "body": "For your personal api-key visit your infrastructure settings in Trace, where you can find a helpful wizard to setup deploy hooks.", "title": "API Key" } [/block] ### Setup via trace-cli [block:code] { "codes": [ { "code": "trace-cli deployhook --git \\\n --service-name=\"my service\" \\ \n --api-key=\"your-trace-api-key\"", "language": "shell" } ] } [/block] For the non GIT specific options check out the [trace-cli docs](https://github.com/risingstack/trace-cli). ### Setup via cURL [block:code] { "codes": [ { "code": "curl \"https://api.trace.risingstack.com/service/${TRACE_SERVICE_NAME}/deployment\" \\\n -X POST \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer ${TRACE_API_KEY}\" \\\n -d '{\n \"revision\": \"'$(git rev-parse HEAD)'\",\n \"description\": \"My deploy\",\n \"user\": \"'$(whoami)'\"\n }''", "language": "shell" } ] } [/block] ### Setup with CircleCI Set your `TRACE_API_KEY` and `TRACE_SERVICE_NAME` as environment variables. [block:code] { "codes": [ { "code": "machine:\n node:\n version: 4.4.4\ntest:\n pre:\n - npm install\n - npm i -g @risingstack/trace-cli\n override:\n - npm test\ndeployment:\n staging:\n branch: master\n commands:\n\t - your-deploy-script\n - trace-cli deployhook —-git", "language": "yaml", "name": "circlecI.yaml" } ] } [/block] ### Setup with Heroku Post Hook Use the UI wizard to retrieve your webhook URL: **Settings > Integration Status > Setup a deploy webhook > Heroku** 1. Add Deploy Hooks addon 2. Provision the HTTP Post Hook type 3. Set URL to the one from the wizard ### Setup via UI It's possible to use our wizard to setup deployment webhooks. You can find it in the **Settings > Integration Status > Setup a deploy webhook**