{"action":"closed","issue":{"url":"https://api.github.com/repos/elastic/apm-agent-nodejs/issues/272","repository_url":"https://api.github.com/repos/elastic/apm-agent-nodejs","labels_url":"https://api.github.com/repos/elastic/apm-agent-nodejs/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/elastic/apm-agent-nodejs/issues/272/comments","events_url":"https://api.github.com/repos/elastic/apm-agent-nodejs/issues/272/events","html_url":"https://github.com/elastic/apm-agent-nodejs/issues/272","id":304793122,"number":272,"title":"Allow setting of result when ending transaction","user":{"login":"watson","id":10602,"avatar_url":"https://avatars3.githubusercontent.com/u/10602?v=4","gravatar_id":"","url":"https://api.github.com/users/watson","html_url":"https://github.com/watson","followers_url":"https://api.github.com/users/watson/followers","following_url":"https://api.github.com/users/watson/following{/other_user}","gists_url":"https://api.github.com/users/watson/gists{/gist_id}","starred_url":"https://api.github.com/users/watson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watson/subscriptions","organizations_url":"https://api.github.com/users/watson/orgs","repos_url":"https://api.github.com/users/watson/repos","events_url":"https://api.github.com/users/watson/events{/privacy}","received_events_url":"https://api.github.com/users/watson/received_events","type":"User","site_admin":false},"labels":[{"id":882569428,"url":"https://api.github.com/repos/elastic/apm-agent-nodejs/labels/[zube]:%20In%20Review","name":"[zube]: In Review","color":"ffffff","default":false},{"id":673291026,"url":"https://api.github.com/repos/elastic/apm-agent-nodejs/labels/discuss","name":"discuss","color":"fbca04","default":false},{"id":664230009,"url":"https://api.github.com/repos/elastic/apm-agent-nodejs/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"closed","locked":false,"assignee":{"login":"Qard","id":205482,"avatar_url":"https://avatars0.githubusercontent.com/u/205482?v=4","gravatar_id":"","url":"https://api.github.com/users/Qard","html_url":"https://github.com/Qard","followers_url":"https://api.github.com/users/Qard/followers","following_url":"https://api.github.com/users/Qard/following{/other_user}","gists_url":"https://api.github.com/users/Qard/gists{/gist_id}","starred_url":"https://api.github.com/users/Qard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qard/subscriptions","organizations_url":"https://api.github.com/users/Qard/orgs","repos_url":"https://api.github.com/users/Qard/repos","events_url":"https://api.github.com/users/Qard/events{/privacy}","received_events_url":"https://api.github.com/users/Qard/received_events","type":"User","site_admin":false},"assignees":[{"login":"Qard","id":205482,"avatar_url":"https://avatars0.githubusercontent.com/u/205482?v=4","gravatar_id":"","url":"https://api.github.com/users/Qard","html_url":"https://github.com/Qard","followers_url":"https://api.github.com/users/Qard/followers","following_url":"https://api.github.com/users/Qard/following{/other_user}","gists_url":"https://api.github.com/users/Qard/gists{/gist_id}","starred_url":"https://api.github.com/users/Qard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qard/subscriptions","organizations_url":"https://api.github.com/users/Qard/orgs","repos_url":"https://api.github.com/users/Qard/repos","events_url":"https://api.github.com/users/Qard/events{/privacy}","received_events_url":"https://api.github.com/users/Qard/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2018-03-13T14:41:32Z","updated_at":"2018-05-09T05:28:43Z","closed_at":"2018-05-09T05:28:43Z","author_association":"MEMBER","body":"A common pattern today when working with custom transactions are:\r\n\r\n```js\r\nvar trans = agent.startTransaction('name', 'type')\r\ndoSomeWork(function (err) {\r\n  if (err) trans.result = 'error'\r\n  trans.end()\r\n})\r\n```\r\n\r\nIt might prove useful to be able to pass a result to the `end` function, eg:\r\n\r\n```js\r\nvar trans = agent.startTransaction('name', 'type')\r\ndoSomeWork(function (err) {\r\n  trans.end(err && 'error')\r\n})\r\n```"}}
{"actor":{"display_login":"watson"}}