-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Description
Description
Here
fxa/packages/fxa-shared/db/redis.ts
Line 210 in 4dfbfbc
| this.metrics?.histogram( |
If metrics is not enabled, mock Statsd will be used:
fxa/packages/fxa-auth-server/bin/key_server.js
Lines 43 to 55 in 4dfbfbc
| const statsd = config.statsd.enabled | |
| ? new StatsD({ | |
| ...config.statsd, | |
| errorHandler: (err) => { | |
| // eslint-disable-next-line no-use-before-define | |
| log.error('statsd.error', err); | |
| }, | |
| }) | |
| : { | |
| increment: () => {}, | |
| timing: () => {}, | |
| close: () => {}, | |
| }; |
However it lacks of function histogram
metrics is initialized here :
fxa/packages/fxa-auth-server/lib/redis.js
Lines 19 to 23 in 4dfbfbc
| function resolveMetrics() { | |
| if (Container.has(StatsD)) { | |
| return Container.get(StatsD); | |
| } | |
| } |
Solution:
- Either set metrics to undefined if metrics is not enabled, like here
fxa/packages/fxa-graphql-api/src/scripts/must-change-password.ts
Lines 38 to 46 in 4dfbfbc
const metrics = config.metrics?.host ? new StatsD({ ...config.metrics, errorHandler: (err) => { // eslint-disable-next-line no-use-before-define logger.error('statsd.error', { err }); }, }) : undefined; - Or mock
histogramfunction (and possibly other functions)
┆Issue is synchronized with this Jira Task
Metadata
Metadata
Assignees
Labels
No labels