2021-07-14 23:49:18 +03:00
|
|
|
import StatsD from 'hot-shots'
|
2020-11-13 23:49:50 +03:00
|
|
|
|
2022-01-28 00:31:35 +03:00
|
|
|
const { HEROKU_APP_NAME, NODE_ENV, DD_API_KEY } = process.env
|
|
|
|
const mock = Boolean(NODE_ENV === 'test' || !DD_API_KEY)
|
2020-11-13 23:49:50 +03:00
|
|
|
|
2022-01-28 00:31:35 +03:00
|
|
|
export const tags = ['app:docs', HEROKU_APP_NAME ? `heroku_app:${HEROKU_APP_NAME}` : false].filter(
|
|
|
|
Boolean
|
|
|
|
)
|
2020-11-13 23:49:50 +03:00
|
|
|
/**
|
|
|
|
* @type {import('hot-shots').StatsD}
|
|
|
|
*/
|
2021-07-14 23:49:18 +03:00
|
|
|
export default new StatsD({
|
2020-11-13 23:49:50 +03:00
|
|
|
prefix: 'docs.',
|
|
|
|
mock,
|
2022-01-28 00:31:35 +03:00
|
|
|
globalTags: tags,
|
2020-11-13 23:49:50 +03:00
|
|
|
})
|