(event: TelemetryEvent)
| 41 | } |
| 42 | |
| 43 | protected async getEventProperties(event: TelemetryEvent): Promise<TelemetryEvent["properties"]> { |
| 44 | let providerProperties: TelemetryEvent["properties"] = {} |
| 45 | const provider = this.providerRef?.deref() |
| 46 | |
| 47 | if (provider) { |
| 48 | try { |
| 49 | // Get properties from the provider |
| 50 | providerProperties = await provider.getTelemetryProperties() |
| 51 | } catch (error) { |
| 52 | // Log error but continue with capturing the event. |
| 53 | console.error( |
| 54 | `Error getting telemetry properties: ${error instanceof Error ? error.message : String(error)}`, |
| 55 | ) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // Merge provider properties with event-specific properties. |
| 60 | // Event properties take precedence in case of conflicts. |
| 61 | const mergedProperties = { |
| 62 | ...providerProperties, |
| 63 | ...(event.properties || {}), |
| 64 | } |
| 65 | |
| 66 | // Filter out properties that shouldn't be captured by this client |
| 67 | return Object.fromEntries(Object.entries(mergedProperties).filter(([key]) => this.isPropertyCapturable(key))) |
| 68 | } |
| 69 | |
| 70 | public abstract capture(event: TelemetryEvent): Promise<void> |
| 71 |
no test coverage detected