( envVar: keyof typeof METRICS_CARDINALITY_DEFAULTS, )
| 14 | } |
| 15 | |
| 16 | function shouldIncludeAttribute( |
| 17 | envVar: keyof typeof METRICS_CARDINALITY_DEFAULTS, |
| 18 | ): boolean { |
| 19 | const defaultValue = METRICS_CARDINALITY_DEFAULTS[envVar] |
| 20 | const envValue = process.env[envVar] |
| 21 | |
| 22 | if (envValue === undefined) { |
| 23 | return defaultValue |
| 24 | } |
| 25 | |
| 26 | return isEnvTruthy(envValue) |
| 27 | } |
| 28 | |
| 29 | export function getTelemetryAttributes(): Attributes { |
| 30 | const userId = getOrCreateUserID() |
no test coverage detected