(tracingClient, request3, userAgent)
| 76568 | packageName: "@azure/core-rest-pipeline", |
| 76569 | packageVersion: SDK_VERSION |
| 76570 | }); |
| 76571 | } catch (e3) { |
| 76572 | logger.warning(`Error when creating the TracingClient: ${getErrorMessage(e3)}`); |
| 76573 | return void 0; |
| 76574 | } |
| 76575 | } |
| 76576 | function tryCreateSpan(tracingClient, request3, userAgent) { |
| 76577 | try { |
| 76578 | const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request3.method}`, { tracingOptions: request3.tracingOptions }, { |
| 76579 | spanKind: "client", |
| 76580 | spanAttributes: { |
| 76581 | "http.method": request3.method, |
| 76582 | "http.url": request3.url, |
| 76583 | requestId: request3.requestId |
| 76584 | } |
| 76585 | }); |
| 76586 | if (!span.isRecording()) { |
| 76587 | span.end(); |
| 76588 | return void 0; |
| 76589 | } |
| 76590 | if (userAgent) { |
| 76591 | span.setAttribute("http.user_agent", userAgent); |
| 76592 | } |
| 76593 | const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); |
| 76594 | for (const [key, value] of Object.entries(headers)) { |
| 76595 | request3.headers.set(key, value); |
| 76596 | } |
| 76597 | return { span, tracingContext: updatedOptions.tracingOptions.tracingContext }; |
| 76598 | } catch (e3) { |
| 76599 | logger.warning(`Skipping creating a tracing span due to an error: ${getErrorMessage(e3)}`); |
no test coverage detected
searching dependent graphs…