-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add datadog metrics * feat: full async/await
- Loading branch information
1 parent
25d29dd
commit c024451
Showing
13 changed files
with
443 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ appId= | |
apiKey= | ||
indexName=npm-search | ||
bootstrapIndexName=npm-search-bootstrap | ||
DOGSTATSD_HOST="localhost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import StatsD from 'hot-shots'; | ||
import log from './log.js'; | ||
|
||
const env = process.env.NODE_ENV === 'production' ? 'prod' : 'dev'; | ||
|
||
const client = new StatsD({ | ||
host: process.env.DOGSTATSD_HOST || 'localhost', | ||
port: 8125, | ||
prefix: 'alg.npmsearch.', | ||
globalTags: { | ||
env, | ||
}, | ||
errorHandler(error) { | ||
log.error('[DATADOG ERROR]', error); | ||
}, | ||
}); | ||
|
||
export default client; |
Oops, something went wrong.