* @inheritdoc
(
name: string,
attributesOrStartTime?: SpanAttributes | SpanTimeInput,
startTime?: SpanTimeInput,
)
| 287 | * @inheritdoc |
| 288 | */ |
| 289 | public addEvent( |
| 290 | name: string, |
| 291 | attributesOrStartTime?: SpanAttributes | SpanTimeInput, |
| 292 | startTime?: SpanTimeInput, |
| 293 | ): this { |
| 294 | DEBUG_BUILD && debug.log('[Tracing] Adding an event to span:', name); |
| 295 | |
| 296 | const time = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds(); |
| 297 | const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; |
| 298 | |
| 299 | const event: TimedEvent = { |
| 300 | name, |
| 301 | time: spanTimeInputToSeconds(time), |
| 302 | attributes, |
| 303 | }; |
| 304 | |
| 305 | this._events.push(event); |
| 306 | |
| 307 | return this; |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * This method should generally not be used, |
nothing calls this directly
no test coverage detected