* Send a fully prepared event to Sentry.
(event: Event, hint: EventHint = {})
| 548 | * Send a fully prepared event to Sentry. |
| 549 | */ |
| 550 | public sendEvent(event: Event, hint: EventHint = {}): void { |
| 551 | this.emit('beforeSendEvent', event, hint); |
| 552 | |
| 553 | // Extract gen_ai spans from transaction and convert to span v2 format. |
| 554 | // This mutates event.spans to remove the extracted spans. |
| 555 | const genAiSpanItem = extractGenAiSpansFromEvent(event, this); |
| 556 | |
| 557 | let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); |
| 558 | |
| 559 | for (const attachment of hint.attachments || []) { |
| 560 | env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment)); |
| 561 | } |
| 562 | |
| 563 | if (genAiSpanItem) { |
| 564 | env = addItemToEnvelope(env, genAiSpanItem); |
| 565 | } |
| 566 | |
| 567 | // sendEnvelope should not throw |
| 568 | // eslint-disable-next-line @typescript-eslint/no-floating-promises |
| 569 | this.sendEnvelope(env).then(sendResponse => this.emit('afterSendEvent', event, sendResponse)); |
| 570 | } |
| 571 | |
| 572 | /** |
| 573 | * Send a session or session aggregrates to Sentry. |
nothing calls this directly
no test coverage detected