()
| 79 | } |
| 80 | |
| 81 | export function getTelemetryAttributes(): Attributes { |
| 82 | const userId = getOrCreateUserID() |
| 83 | const sessionId = getSessionId() |
| 84 | |
| 85 | const attributes: Attributes = { |
| 86 | 'user.id': userId, |
| 87 | } |
| 88 | |
| 89 | if (shouldIncludeAttribute('OTEL_METRICS_INCLUDE_SESSION_ID')) { |
| 90 | attributes['session.id'] = sessionId |
| 91 | } |
| 92 | if (shouldIncludeAttribute('OTEL_METRICS_INCLUDE_VERSION')) { |
| 93 | attributes['app.version'] = MACRO.VERSION |
| 94 | } |
| 95 | |
| 96 | Object.assign( |
| 97 | attributes, |
| 98 | buildTelemetryIdentityAttributes(getAuthRuntime().getCurrentSession()), |
| 99 | ) |
| 100 | |
| 101 | // Add terminal type if available |
| 102 | if (envDynamic.terminal) { |
| 103 | attributes['terminal.type'] = envDynamic.terminal |
| 104 | } |
| 105 | |
| 106 | return attributes |
| 107 | } |
no test coverage detected