diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3e7db2cdca2c..0e4dd792966b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -603,20 +603,20 @@ packages: node: '>=8.0.0' resolution: integrity: sha512-5Y8WgETz0lnAoksk8qpEOJ6PBnPV8edscusKiwbfm7rfadsfm1rl+kZPJP8YrjkY+bfnMNeixVZHe8QB5Mpa8Q== - /@azure/keyvault-keys/4.2.2: + /@azure/keyvault-keys/4.3.0: dependencies: '@azure/abort-controller': 1.0.4 - '@azure/core-http': 1.2.6 - '@azure/core-lro': 1.0.5 + '@azure/core-http': 2.0.0 + '@azure/core-lro': 2.1.0 '@azure/core-paging': 1.1.3 - '@azure/core-tracing': 1.0.0-preview.11 + '@azure/core-tracing': 1.0.0-preview.13 '@azure/logger': 1.0.2 tslib: 2.3.0 dev: false engines: node: '>=8.0.0' resolution: - integrity: sha512-SWRx0Z8ShLYnuqCitIOi3DqLSLBTI6G1F+Wv5/hy1w6ZXRnOwc74deQ8kfO0Tbm3n09SpaN4ytp6dmg6C2cRmQ== + integrity: sha512-OEosl0/rE/mKD5Ji9KaQN7UH+yQnV5MS0MRhGqQIiJrG+qAvAla0MYudJzv3XvBlplpGk0+MVgyL9H3KX/UAwQ== /@azure/keyvault-secrets/4.2.0: dependencies: '@azure/abort-controller': 1.0.4 @@ -9754,7 +9754,7 @@ packages: dev: false name: '@rush-temp/core-lro' resolution: - integrity: sha512-NKGKcVkQq77E2dNBLMGvX3XKfoUspXmK7ozUe81I/hNJ1mX7kHTQ3/SV59NyKCjPoo+VTouUCWxoIgIvbIeHdg== + integrity: sha512-Y2f1/wq45+YJ5+b/fGG4iq5/71zNaMWWG0BA5R8Twwl+JnuEOnRmyumNlNsE4Hk+CI4ae9j+9q5gSqXpCI9AQA== tarball: file:projects/core-lro.tgz version: 0.0.0 file:projects/core-paging.tgz: @@ -10694,7 +10694,7 @@ packages: dependencies: '@azure/core-tracing': 1.0.0-preview.13 '@azure/identity': 2.0.0-beta.4 - '@azure/keyvault-keys': 4.2.2 + '@azure/keyvault-keys': 4.3.0 '@microsoft/api-extractor': 7.7.11 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 '@rollup/plugin-json': 4.1.0_rollup@1.32.1 @@ -10733,7 +10733,7 @@ packages: dev: false name: '@rush-temp/keyvault-admin' resolution: - integrity: sha512-4Sad+EJvcdIpngD18lwX00p0mmCXdXDW2ORKKHEmoibtPifUEGjeLj6rAmjp7ASENfVUZOKrUL0TDlEnZsnWnA== + integrity: sha512-2z1j71wQm+CA1yCpv6ynbeRx1O81rSn5c2Iq9ixJPUtcWzlUlqlPoD0lZe8pUG4AZgllp/TkHzFKXMnI6w8Sbw== tarball: file:projects/keyvault-admin.tgz version: 0.0.0 file:projects/keyvault-certificates.tgz: @@ -10791,7 +10791,7 @@ packages: dev: false name: '@rush-temp/keyvault-certificates' resolution: - integrity: sha512-it16rS6uGe4Z5tFyX4yxkuBpApC+ZbRtE3pokXvcoSl2IIFRamKQBjJYDXTmdYC0ThdjaMLrNkml7T5F2TclOw== + integrity: sha512-zoNQZQ4IZd/RByVuCzAPguoOGTyRSjFcUq3A2UGZ2+gqVBxzqDO/D+hcBm2HTj6k4GQ9F/kOqUTjq0sG5akQqQ== tarball: file:projects/keyvault-certificates.tgz version: 0.0.0 file:projects/keyvault-common.tgz: @@ -10922,7 +10922,7 @@ packages: dev: false name: '@rush-temp/keyvault-secrets' resolution: - integrity: sha512-sB13JiMVhsiOxR/k1TRi8+WlJ1qNem5+7bFyrm4tbQepgLOfVgQ5GGJkkPJ+AqbZUYkLsHguIfvxrtQDdHlAVA== + integrity: sha512-b5NL934qZfLpp6MKDL9M8uR5x0b2VCsWXqKUKSjshAc8Z9A3YQoNAT/ue/Vr/sTppAMn+2ViypgU1CBRlAiEsQ== tarball: file:projects/keyvault-secrets.tgz version: 0.0.0 file:projects/logger.tgz: @@ -11310,7 +11310,7 @@ packages: version: 0.0.0 file:projects/perf-keyvault-keys.tgz: dependencies: - '@azure/keyvault-keys': 4.2.2 + '@azure/keyvault-keys': 4.3.0 '@types/uuid': 8.3.1 dotenv: 8.6.0 eslint: 7.31.0 @@ -11323,7 +11323,7 @@ packages: dev: false name: '@rush-temp/perf-keyvault-keys' resolution: - integrity: sha512-9fQgixzmC5EXGxuFD9cFsUOewEzvxv6bGIrc0RI+B4wsbvH5T+kYhn3gl5WhHz387mEL4/UsmrXZ7sIn0brQUQ== + integrity: sha512-91/Tx4OHQGYIZj11JvQSbw2MIOZ56eBLPlpoIGSgij03GN0WUccmDGUdLRVxrn3dgZ3MLIIg7ESSZLINuHCbyA== tarball: file:projects/perf-keyvault-keys.tgz version: 0.0.0 file:projects/perf-keyvault-secrets.tgz: diff --git a/sdk/core/core-client/review/core-client.api.md b/sdk/core/core-client/review/core-client.api.md index 93e52f8c0ebe..acae323c050f 100644 --- a/sdk/core/core-client/review/core-client.api.md +++ b/sdk/core/core-client/review/core-client.api.md @@ -5,6 +5,7 @@ ```ts import { AbortSignalLike } from '@azure/abort-controller'; +import { createSpanFunction } from '@azure/core-tracing'; import { HttpClient } from '@azure/core-rest-pipeline'; import { HttpMethods } from '@azure/core-rest-pipeline'; import { InternalPipelineOptions } from '@azure/core-rest-pipeline'; @@ -14,6 +15,9 @@ import { PipelineOptions } from '@azure/core-rest-pipeline'; import { PipelinePolicy } from '@azure/core-rest-pipeline'; import { PipelineRequest } from '@azure/core-rest-pipeline'; import { PipelineResponse } from '@azure/core-rest-pipeline'; +import { Span } from '@azure/core-tracing'; +import { SpanKind } from '@azure/core-tracing'; +import { SpanStatusCode } from '@azure/core-tracing'; import { TokenCredential } from '@azure/core-auth'; import { TransferProgressEvent } from '@azure/core-rest-pipeline'; @@ -73,6 +77,8 @@ export function createSerializer(modelMappers?: { [key: string]: any; }, isXML?: boolean): Serializer; +export { createSpanFunction } + // @public export interface DeserializationContentTypes { json?: string[]; @@ -269,6 +275,8 @@ export interface OperationSpec { readonly urlParameters?: ReadonlyArray; } +export { OperationTracingOptions } + // @public export interface OperationURLParameter extends OperationParameter { skipEncoding?: boolean; @@ -365,12 +373,18 @@ export interface SimpleMapperType { name: "Base64Url" | "Boolean" | "ByteArray" | "Date" | "DateTime" | "DateTimeRfc1123" | "Object" | "Stream" | "String" | "TimeSpan" | "UnixTime" | "Uuid" | "Number" | "any"; } +export { Span } + // @public export interface SpanConfig { namespace: string; packagePrefix: string; } +export { SpanKind } + +export { SpanStatusCode } + // @public export const XML_ATTRKEY = "$"; diff --git a/sdk/core/core-client/src/index.ts b/sdk/core/core-client/src/index.ts index de6d200d993b..17172b686735 100644 --- a/sdk/core/core-client/src/index.ts +++ b/sdk/core/core-client/src/index.ts @@ -39,7 +39,12 @@ export { XmlOptions, SerializerOptions, RawResponseCallback, - CommonClientOptions + CommonClientOptions, + Span, + SpanKind, + OperationTracingOptions, + SpanStatusCode, + createSpanFunction } from "./interfaces"; export { deserializationPolicy, diff --git a/sdk/core/core-client/src/interfaces.ts b/sdk/core/core-client/src/interfaces.ts index b8dc9dab2d93..2cab2383dd38 100644 --- a/sdk/core/core-client/src/interfaces.ts +++ b/sdk/core/core-client/src/interfaces.ts @@ -3,6 +3,7 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { OperationTracingOptions } from "@azure/core-tracing"; +import { createSpanFunction, Span, SpanKind, SpanStatusCode } from "@azure/core-tracing"; import { HttpMethods, PipelineResponse, @@ -559,3 +560,5 @@ export interface CommonClientOptions extends PipelineOptions { */ allowInsecureConnection?: boolean; } + +export { createSpanFunction, Span, SpanKind, SpanStatusCode, OperationTracingOptions }; diff --git a/sdk/core/core-http/review/core-http.api.md b/sdk/core/core-http/review/core-http.api.md index 252b55527f93..5d8f91512cbd 100644 --- a/sdk/core/core-http/review/core-http.api.md +++ b/sdk/core/core-http/review/core-http.api.md @@ -7,12 +7,16 @@ import { AbortSignalLike } from '@azure/abort-controller'; import { AccessToken } from '@azure/core-auth'; import { Context } from '@azure/core-tracing'; +import { createSpanFunction } from '@azure/core-tracing'; +import { CreateSpanFunctionArgs } from '@azure/core-tracing'; import { Debugger } from '@azure/logger'; import { GetTokenOptions } from '@azure/core-auth'; import { isTokenCredential } from '@azure/core-auth'; import { OperationTracingOptions } from '@azure/core-tracing'; import { Span } from '@azure/core-tracing'; +import { SpanKind } from '@azure/core-tracing'; import { SpanOptions } from '@azure/core-tracing'; +import { SpanStatusCode } from '@azure/core-tracing'; import { TokenCredential } from '@azure/core-auth'; export { AbortSignalLike } @@ -159,11 +163,11 @@ export const Constants: { // @public (undocumented) export function createPipelineFromOptions(pipelineOptions: InternalPipelineOptions, authPolicyFactory?: RequestPolicyFactory): ServiceClientOptions; -// @public @deprecated -export function createSpanFunction(args: SpanConfig): (operationName: string, operationOptions: T) => { - span: Span; - updatedOptions: T; -}; +export { createSpanFunction } + +export { CreateSpanFunctionArgs } + +export { CreateSpanFunctionArgs as SpanConfig } // Warning: (ae-forgotten-export) The symbol "FetchHttpClient" needs to be exported by the entry point coreHttp.d.ts // @@ -505,6 +509,8 @@ export interface OperationSpec { readonly urlParameters?: ReadonlyArray; } +export { OperationTracingOptions } + // @public export interface OperationURLParameter extends OperationParameter { skipEncoding?: boolean; @@ -806,11 +812,11 @@ export interface SimpleMapperType { name: "Base64Url" | "Boolean" | "ByteArray" | "Date" | "DateTime" | "DateTimeRfc1123" | "Object" | "Stream" | "String" | "TimeSpan" | "UnixTime" | "Uuid" | "Number" | "any"; } -// @public @deprecated -export interface SpanConfig { - namespace: string; - packagePrefix: string; -} +export { Span } + +export { SpanKind } + +export { SpanStatusCode } // @public export function stringifyXML(obj: unknown, opts?: SerializerOptions): string; diff --git a/sdk/core/core-http/src/coreHttp.ts b/sdk/core/core-http/src/coreHttp.ts index 6e726f0cffb6..af06f16a8c76 100644 --- a/sdk/core/core-http/src/coreHttp.ts +++ b/sdk/core/core-http/src/coreHttp.ts @@ -113,8 +113,15 @@ export { export { URLBuilder, URLQuery } from "./url"; export { AbortSignalLike } from "@azure/abort-controller"; export { delay } from "./util/delay"; -// legacy exports. Use core-tracing instead (and remove on next major version update of core-http). -export { createSpanFunction, SpanConfig } from "./createSpanLegacy"; +export { + Span, + SpanConfig, + SpanStatusCode, + createSpanFunction, + SpanKind, + CreateSpanFunctionArgs, + OperationTracingOptions +} from "./util/tracing"; // Credentials export { TokenCredential, GetTokenOptions, AccessToken, isTokenCredential } from "@azure/core-auth"; diff --git a/sdk/core/core-http/src/createSpanLegacy.ts b/sdk/core/core-http/src/createSpanLegacy.ts deleted file mode 100644 index e1a3fef1d625..000000000000 --- a/sdk/core/core-http/src/createSpanLegacy.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -// NOTE: we've moved this code into core-tracing but these functions -// were a part of the GA'd library and can't be removed until the next major -// release. They currently get called always, even if tracing is not enabled. - -import { createSpanFunction as coreTracingCreateSpanFunction, Span } from "@azure/core-tracing"; -import { OperationOptions } from "./operationOptions"; - -/** - * This function is only here for compatibility. Use createSpanFunction in core-tracing. - * - * @deprecated This function is only here for compatibility. Use core-tracing instead. - * @hidden - */ -export interface SpanConfig { - /** - * Package name prefix - */ - packagePrefix: string; - /** - * Service namespace - */ - namespace: string; -} - -/** - * This function is only here for compatibility. Use createSpanFunction in core-tracing. - * - * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing. - * @hidden - - * @param spanConfig - The name of the operation being performed. - * @param tracingOptions - The options for the underlying http request. - */ -export function createSpanFunction( - args: SpanConfig -): ( - operationName: string, - operationOptions: T -) => { span: Span; updatedOptions: T } { - return coreTracingCreateSpanFunction(args); -} diff --git a/sdk/core/core-http/src/util/tracing.ts b/sdk/core/core-http/src/util/tracing.ts new file mode 100644 index 000000000000..07c29927b961 --- /dev/null +++ b/sdk/core/core-http/src/util/tracing.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export { + createSpanFunction, + CreateSpanFunctionArgs, + CreateSpanFunctionArgs as SpanConfig, // for backwards compatibility + Span, + SpanStatusCode, + SpanKind, + OperationTracingOptions +} from "@azure/core-tracing"; diff --git a/sdk/core/core-lro/package.json b/sdk/core/core-lro/package.json index 512ea39b29b8..db45f0cce4f8 100644 --- a/sdk/core/core-lro/package.json +++ b/sdk/core/core-lro/package.json @@ -91,7 +91,6 @@ "sideEffects": false, "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, diff --git a/sdk/deviceupdate/iot-device-update/src/operations/deployments.ts b/sdk/deviceupdate/iot-device-update/src/operations/deployments.ts index bc6dd19af942..bc636b65f5dd 100644 --- a/sdk/deviceupdate/iot-device-update/src/operations/deployments.ts +++ b/sdk/deviceupdate/iot-device-update/src/operations/deployments.ts @@ -141,7 +141,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getAllDeployments", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { options: updatedOptions @@ -172,10 +172,7 @@ export class Deployments { deploymentId: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getDeployment", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getDeployment", options || {}); const operationArguments: coreHttp.OperationArguments = { deploymentId, options: updatedOptions @@ -210,7 +207,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-createOrUpdateDeployment", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, @@ -245,7 +242,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-deleteDeployment", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, @@ -280,7 +277,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-getDeploymentStatus", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, @@ -315,7 +312,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getDeploymentDevices", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, @@ -349,7 +346,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-cancelDeployment", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, @@ -383,7 +380,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-retryDeployment", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, @@ -417,7 +414,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getAllDeploymentsNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { nextLink, @@ -453,7 +450,7 @@ export class Deployments { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getDeploymentDevicesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { deploymentId, diff --git a/sdk/deviceupdate/iot-device-update/src/operations/devices.ts b/sdk/deviceupdate/iot-device-update/src/operations/devices.ts index 22967b6141bb..ebd582346dab 100644 --- a/sdk/deviceupdate/iot-device-update/src/operations/devices.ts +++ b/sdk/deviceupdate/iot-device-update/src/operations/devices.ts @@ -379,12 +379,9 @@ export class Devices { private async _getAllDeviceClasses( options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getAllDeviceClasses", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getAllDeviceClasses", options); const operationArguments: coreHttp.OperationArguments = { - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -412,13 +409,10 @@ export class Devices { deviceClassId: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getDeviceClass", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getDeviceClass", options); const operationArguments: coreHttp.OperationArguments = { deviceClassId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -448,11 +442,11 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getDeviceClassDeviceIds", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { deviceClassId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -482,11 +476,11 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getDeviceClassInstallableUpdates", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { deviceClassId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -512,12 +506,9 @@ export class Devices { private async _getAllDevices( options?: DevicesGetAllDevicesOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getAllDevices", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getAllDevices", options); const operationArguments: coreHttp.OperationArguments = { - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -546,13 +537,10 @@ export class Devices { deviceId: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getDevice", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getDevice", options); const operationArguments: coreHttp.OperationArguments = { deviceId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -579,12 +567,9 @@ export class Devices { async getUpdateCompliance( options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getUpdateCompliance", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getUpdateCompliance", options); const operationArguments: coreHttp.OperationArguments = { - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -610,12 +595,9 @@ export class Devices { private async _getAllDeviceTags( options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getAllDeviceTags", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getAllDeviceTags", options); const operationArguments: coreHttp.OperationArguments = { - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -643,13 +625,10 @@ export class Devices { tagName: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getDeviceTag", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getDeviceTag", options); const operationArguments: coreHttp.OperationArguments = { tagName, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -675,12 +654,9 @@ export class Devices { private async _getAllGroups( options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getAllGroups", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getAllGroups", options); const operationArguments: coreHttp.OperationArguments = { - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -708,13 +684,10 @@ export class Devices { groupId: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getGroup", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getGroup", options); const operationArguments: coreHttp.OperationArguments = { groupId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -744,14 +717,11 @@ export class Devices { group: Group, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-createOrUpdateGroup", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-createOrUpdateGroup", options); const operationArguments: coreHttp.OperationArguments = { groupId, group, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -779,13 +749,10 @@ export class Devices { groupId: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-deleteGroup", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-deleteGroup", options); const operationArguments: coreHttp.OperationArguments = { groupId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -816,11 +783,11 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-getGroupUpdateCompliance", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { groupId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -848,13 +815,10 @@ export class Devices { groupId: string, options?: DevicesGetGroupBestUpdatesOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getGroupBestUpdates", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getGroupBestUpdates", options); const operationArguments: coreHttp.OperationArguments = { groupId, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -884,11 +848,11 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getAllDeviceClassesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -921,12 +885,12 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getDeviceClassDeviceIdsNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { deviceClassId, nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -959,12 +923,12 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getDeviceClassInstallableUpdatesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { deviceClassId, nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -992,13 +956,10 @@ export class Devices { nextLink: string, options?: DevicesGetAllDevicesNextOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getAllDevicesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getAllDevicesNext", options); const operationArguments: coreHttp.OperationArguments = { nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -1028,11 +989,11 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getAllDeviceTagsNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -1060,13 +1021,10 @@ export class Devices { nextLink: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getAllGroupsNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getAllGroupsNext", options); const operationArguments: coreHttp.OperationArguments = { nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( @@ -1098,12 +1056,12 @@ export class Devices { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getGroupBestUpdatesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options ); const operationArguments: coreHttp.OperationArguments = { groupId, nextLink, - options: updatedOptions + options: coreHttp.operationOptionsToRequestOptionsBase(updatedOptions) }; try { const result = await this.client.sendOperationRequest( diff --git a/sdk/deviceupdate/iot-device-update/src/operations/updates.ts b/sdk/deviceupdate/iot-device-update/src/operations/updates.ts index 73a074be1dcf..cdb987ca8bec 100644 --- a/sdk/deviceupdate/iot-device-update/src/operations/updates.ts +++ b/sdk/deviceupdate/iot-device-update/src/operations/updates.ts @@ -292,10 +292,7 @@ export class Updates { updateToImport: ImportUpdateInput, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-importUpdate", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-importUpdate", options || {}); const operationArguments: coreHttp.OperationArguments = { updateToImport, options: updatedOptions @@ -330,10 +327,7 @@ export class Updates { version: string, options?: UpdatesGetUpdateOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getUpdate", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getUpdate", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, name, @@ -370,10 +364,7 @@ export class Updates { version: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-deleteUpdate", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-deleteUpdate", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, name, @@ -404,10 +395,7 @@ export class Updates { private async _getProviders( options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getProviders", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getProviders", options || {}); const operationArguments: coreHttp.OperationArguments = { options: updatedOptions }; @@ -437,10 +425,7 @@ export class Updates { provider: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getNames", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getNames", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, options: updatedOptions @@ -473,10 +458,7 @@ export class Updates { name: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getVersions", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getVersions", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, name, @@ -512,10 +494,7 @@ export class Updates { version: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getFiles", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getFiles", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, name, @@ -554,10 +533,7 @@ export class Updates { fileId: string, options?: UpdatesGetFileOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getFile", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getFile", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, name, @@ -590,10 +566,7 @@ export class Updates { private async _getOperations( options?: UpdatesGetOperationsOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getOperations", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getOperations", options || {}); const operationArguments: coreHttp.OperationArguments = { options: updatedOptions }; @@ -623,10 +596,7 @@ export class Updates { operationId: string, options?: UpdatesGetOperationOptionalParams ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-getOperation", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-getOperation", options || {}); const operationArguments: coreHttp.OperationArguments = { operationId, options: updatedOptions @@ -659,7 +629,7 @@ export class Updates { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getProvidersNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { nextLink, @@ -693,10 +663,7 @@ export class Updates { nextLink: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getNamesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getNamesNext", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, nextLink, @@ -734,7 +701,7 @@ export class Updates { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getVersionsNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { provider, @@ -774,10 +741,7 @@ export class Updates { nextLink: string, options?: coreHttp.OperationOptions ): Promise { - const { span, updatedOptions } = createSpan( - "DeviceUpdateClient-_getFilesNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) - ); + const { span, updatedOptions } = createSpan("DeviceUpdateClient-_getFilesNext", options || {}); const operationArguments: coreHttp.OperationArguments = { provider, name, @@ -813,7 +777,7 @@ export class Updates { ): Promise { const { span, updatedOptions } = createSpan( "DeviceUpdateClient-_getOperationsNext", - coreHttp.operationOptionsToRequestOptionsBase(options || {}) + options || {} ); const operationArguments: coreHttp.OperationArguments = { nextLink, diff --git a/sdk/keyvault/keyvault-admin/package.json b/sdk/keyvault/keyvault-admin/package.json index dffdc9982f0a..c61688e814d0 100644 --- a/sdk/keyvault/keyvault-admin/package.json +++ b/sdk/keyvault/keyvault-admin/package.json @@ -110,7 +110,6 @@ "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", "@azure/core-rest-pipeline": "^1.1.0", - "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "@types/uuid": "^8.0.0", "tslib": "^2.2.0", @@ -118,11 +117,12 @@ }, "devDependencies": { "@azure/abort-controller": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.13", "@azure/core-util": "^1.0.0-beta.1", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "2.0.0-beta.4", - "@azure/keyvault-keys": "^4.2.1", + "@azure/keyvault-keys": "^4.3.0", "@azure/test-utils": "^1.0.0", "@azure/test-utils-recorder": "^1.0.0", "@microsoft/api-extractor": "7.7.11", diff --git a/sdk/keyvault/keyvault-admin/src/tracingHelpers.ts b/sdk/keyvault/keyvault-admin/src/tracingHelpers.ts index a20a3f97ce31..bf141b2c49bf 100644 --- a/sdk/keyvault/keyvault-admin/src/tracingHelpers.ts +++ b/sdk/keyvault/keyvault-admin/src/tracingHelpers.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { OperationOptions } from "@azure/core-client"; -import { createSpanFunction, Span, SpanStatusCode } from "@azure/core-tracing"; +import { createSpanFunction, Span, SpanStatusCode } from "@azure/core-client"; /** * An interface representing a function that is traced. diff --git a/sdk/keyvault/keyvault-certificates/package.json b/sdk/keyvault/keyvault-certificates/package.json index 9e9307ded09d..677979dada08 100644 --- a/sdk/keyvault/keyvault-certificates/package.json +++ b/sdk/keyvault/keyvault-certificates/package.json @@ -111,11 +111,11 @@ "@azure/core-http": "^2.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, "devDependencies": { + "@azure/core-tracing": "1.0.0-preview.13", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "2.0.0-beta.5", diff --git a/sdk/keyvault/keyvault-common/package.json b/sdk/keyvault/keyvault-common/package.json index 5b33284ab088..deca2424ae24 100644 --- a/sdk/keyvault/keyvault-common/package.json +++ b/sdk/keyvault/keyvault-common/package.json @@ -58,11 +58,11 @@ }, "dependencies": { "@azure/core-http": "^2.0.0", - "@azure/core-tracing": "1.0.0-preview.13", "tslib": "^2.2.0" }, "devDependencies": { "@azure/test-utils": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.13", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "eslint": "^7.15.0", "prettier": "^1.16.4", diff --git a/sdk/keyvault/keyvault-common/src/tracingHelpers.ts b/sdk/keyvault/keyvault-common/src/tracingHelpers.ts index 564942a77a9e..8335ebf69ded 100644 --- a/sdk/keyvault/keyvault-common/src/tracingHelpers.ts +++ b/sdk/keyvault/keyvault-common/src/tracingHelpers.ts @@ -1,8 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { OperationOptions } from "@azure/core-http"; -import { createSpanFunction, Span, SpanStatusCode } from "@azure/core-tracing"; +import { OperationOptions, createSpanFunction, Span, SpanStatusCode } from "@azure/core-http"; /** * An interface representing a function that is traced. diff --git a/sdk/keyvault/keyvault-keys/package.json b/sdk/keyvault/keyvault-keys/package.json index a9dfce00a399..ce32d8b4d651 100644 --- a/sdk/keyvault/keyvault-keys/package.json +++ b/sdk/keyvault/keyvault-keys/package.json @@ -107,11 +107,11 @@ "@azure/core-http": "^2.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, "devDependencies": { + "@azure/core-tracing": "1.0.0-preview.13", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "2.0.0-beta.4", diff --git a/sdk/keyvault/keyvault-secrets/package.json b/sdk/keyvault/keyvault-secrets/package.json index c47cf6267685..81111e2a110a 100644 --- a/sdk/keyvault/keyvault-secrets/package.json +++ b/sdk/keyvault/keyvault-secrets/package.json @@ -107,11 +107,11 @@ "@azure/core-http": "^2.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, "devDependencies": { + "@azure/core-tracing": "1.0.0-preview.13", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "2.0.0-beta.5", diff --git a/sdk/keyvault/perf-tests/keyvault-keys/package.json b/sdk/keyvault/perf-tests/keyvault-keys/package.json index 07a2cfb9fe1c..6314644dc822 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/package.json +++ b/sdk/keyvault/perf-tests/keyvault-keys/package.json @@ -8,7 +8,7 @@ "license": "ISC", "dependencies": { "@azure/test-utils-perfstress": "^1.0.0", - "@azure/keyvault-keys": "^4.2.1", + "@azure/keyvault-keys": "^4.3.0", "dotenv": "^8.2.0", "@azure/identity": "2.0.0-beta.5", "uuid": "^8.3.0"