( eventName: string, attributes: Record<string, string | number | boolean> )
| 437 | * Track platform events (workflow creation, knowledge base operations, etc.) |
| 438 | */ |
| 439 | export function trackPlatformEvent( |
| 440 | eventName: string, |
| 441 | attributes: Record<string, string | number | boolean> |
| 442 | ): void { |
| 443 | try { |
| 444 | const tracer = getTracer() |
| 445 | const span = tracer.startSpan(eventName, { |
| 446 | attributes: { |
| 447 | ...attributes, |
| 448 | [TraceAttr.EventName]: eventName, |
| 449 | [TraceAttr.EventTimestamp]: Date.now(), |
| 450 | }, |
| 451 | }) |
| 452 | span.setStatus({ code: SpanStatusCode.OK }) |
| 453 | span.end() |
| 454 | } catch (error) { |
| 455 | // Silently fail |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | // ============================================================================ |
| 460 | // PLATFORM TELEMETRY EVENTS |
no test coverage detected