Skip to content

Commit b8f5115

Browse files
authored
Merge pull request github#18647 from github/fix-hydro-stat
cleanup hydro Datadog stats
2 parents bfef839 + 09dfd19 commit b8f5115

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/hydro.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ const fetch = require('node-fetch')
33
const statsd = require('../lib/statsd')
44
const FailBot = require('../lib/failbot')
55

6-
const hydroStats = statsd.childClient({
7-
prefix: 'hydro.'
8-
})
9-
106
const SCHEMAS = {
117
page: 'docs.v0.PageEvent',
128
exit: 'docs.v0.ExitEvent',
@@ -78,10 +74,10 @@ module.exports = class Hydro {
7874
}
7975
})
8076

81-
const res = await hydroStats.asyncTimer(doFetch, 'response_time')()
77+
const res = await statsd.asyncTimer(doFetch, 'hydro.response_time')()
8278

83-
hydroStats.increment(`response_code.${res.statusCode}`, 1)
84-
hydroStats.increment('response_code.all', 1)
79+
statsd.increment(`hydro.response_code.${res.status}`, 1)
80+
statsd.increment('hydro.response_code.all', 1)
8581

8682
// Track hydro exceptions in Sentry, but don't track 503s because we can't do anything about service availability
8783
if (!res.ok && res.status !== 503) {

0 commit comments

Comments
 (0)