Skip to content

Commit

Permalink
Add request route tags to response event (#516)
Browse files Browse the repository at this point in the history
* Add request route tags to response event
  • Loading branch information
csabapalfi authored and arb committed Sep 16, 2016
1 parent 7a78ec8 commit b8f923e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions API.md
Expand Up @@ -191,6 +191,7 @@ Event object associated with the `responseEvent` event option into Good. `reques
- `referer` - the referer headed of the incoming request.
- `route` - route path used by request. Maps to `request.route.path`.
- `log` - maps to `request.getLog()` of the hapi request object.
- `tags` - array of strings representing any tags from route config. Maps to `request.route.settings.tags`.
- `config` - plugin-specific config object combining `request.route.settings.plugins.good` and `request.plugins.good`. Request-level overrides route-level. Reporters could use `config` for additional filtering logic.

### `Ops`
Expand Down
2 changes: 2 additions & 0 deletions lib/utils.js
Expand Up @@ -83,6 +83,8 @@ class RequestSent {
this.log = (request.route.settings.log === false ? [] : request.getLog()); // Explicitly compare to false for hapi < v15
/* $lab:coverage:on$ */

this.tags = request.route.settings.tags;

if (reqOptions.headers) {
this.headers = req.headers;
}
Expand Down

0 comments on commit b8f923e

Please sign in to comment.