Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] core-http and core-client should re-export core-tracing interfaces #16872

Closed
wants to merge 14 commits into from
24 changes: 12 additions & 12 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions sdk/core/core-client/review/core-client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';

Expand Down Expand Up @@ -73,6 +77,8 @@ export function createSerializer(modelMappers?: {
[key: string]: any;
}, isXML?: boolean): Serializer;

export { createSpanFunction }

// @public
export interface DeserializationContentTypes {
json?: string[];
Expand Down Expand Up @@ -269,6 +275,8 @@ export interface OperationSpec {
readonly urlParameters?: ReadonlyArray<OperationURLParameter>;
}

export { OperationTracingOptions }

// @public
export interface OperationURLParameter extends OperationParameter {
skipEncoding?: boolean;
Expand Down Expand Up @@ -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 = "$";

Expand Down
7 changes: 6 additions & 1 deletion sdk/core/core-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ export {
XmlOptions,
SerializerOptions,
RawResponseCallback,
CommonClientOptions
CommonClientOptions,
Span,
SpanKind,
OperationTracingOptions,
SpanStatusCode,
createSpanFunction
} from "./interfaces";
export {
deserializationPolicy,
Expand Down
3 changes: 3 additions & 0 deletions sdk/core/core-client/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -559,3 +560,5 @@ export interface CommonClientOptions extends PipelineOptions {
*/
allowInsecureConnection?: boolean;
}

export { createSpanFunction, Span, SpanKind, SpanStatusCode, OperationTracingOptions };
26 changes: 16 additions & 10 deletions sdk/core/core-http/review/core-http.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -159,11 +163,11 @@ export const Constants: {
// @public (undocumented)
export function createPipelineFromOptions(pipelineOptions: InternalPipelineOptions, authPolicyFactory?: RequestPolicyFactory): ServiceClientOptions;

// @public @deprecated
export function createSpanFunction(args: SpanConfig): <T extends OperationOptions>(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
//
Expand Down Expand Up @@ -505,6 +509,8 @@ export interface OperationSpec {
readonly urlParameters?: ReadonlyArray<OperationURLParameter>;
}

export { OperationTracingOptions }

// @public
export interface OperationURLParameter extends OperationParameter {
skipEncoding?: boolean;
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 9 additions & 2 deletions sdk/core/core-http/src/coreHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
44 changes: 0 additions & 44 deletions sdk/core/core-http/src/createSpanLegacy.ts

This file was deleted.

12 changes: 12 additions & 0 deletions sdk/core/core-http/src/util/tracing.ts
Original file line number Diff line number Diff line change
@@ -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";
1 change: 0 additions & 1 deletion sdk/core/core-lro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Loading