Skip to content

Commit 77b159f

Browse files
authored
[core-auth] remove core-tracing dependency (Azure#13075)
* [core-auth] remove core-tracing dependency * add license header * add note to keep tracing.ts in sync with core-tracing
1 parent d6f67a4 commit 77b159f

File tree

6 files changed

+60
-5
lines changed

6 files changed

+60
-5
lines changed

sdk/core/core-auth/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1.1.4 (Unreleased)
44

5-
- Updated to use OpenTelemetry 0.10.2 via `@azure/core-tracing`
5+
- Removed direct dependency on `@opentelemetry/api` and `@azure/core-tracing`.
66

77
## 1.1.3 (2020-06-30)
88

sdk/core/core-auth/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
"sideEffects": false,
6868
"dependencies": {
6969
"@azure/abort-controller": "^1.0.0",
70-
"@azure/core-tracing": "1.0.0-preview.9",
71-
"@opentelemetry/api": "^0.10.2",
7270
"tslib": "^2.0.0"
7371
},
7472
"devDependencies": {

sdk/core/core-auth/review/core-auth.api.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
```ts
66

77
import { AbortSignalLike } from '@azure/abort-controller';
8-
import { SpanOptions } from '@azure/core-tracing';
98

109
// @public
1110
export interface AccessToken {
@@ -39,6 +38,21 @@ export interface KeyCredential {
3938
readonly key: string;
4039
}
4140

41+
// @public
42+
export interface SpanContext {
43+
spanId: string;
44+
traceFlags: number;
45+
traceId: string;
46+
}
47+
48+
// @public
49+
export interface SpanOptions {
50+
attributes?: {
51+
[key: string]: unknown;
52+
};
53+
parent?: SpanContext | null;
54+
}
55+
4256
// @public
4357
export interface TokenCredential {
4458
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;

sdk/core/core-auth/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ export {
99
AccessToken,
1010
isTokenCredential
1111
} from "./tokenCredential";
12+
13+
export { SpanContext, SpanOptions } from "./tracing";

sdk/core/core-auth/src/tokenCredential.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license.
33

44
import { AbortSignalLike } from "@azure/abort-controller";
5-
import { SpanOptions } from "@azure/core-tracing";
5+
import { SpanOptions } from "./tracing";
66

77
/**
88
* Represents a credential capable of providing an authentication token.

sdk/core/core-auth/src/tracing.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
// The interfaces in this file should be kept in sync with those
5+
// found in the `@azure/core-tracing` package.
6+
7+
/**
8+
* An interface that enables manual propagation of Spans.
9+
*/
10+
export interface SpanOptions {
11+
/**
12+
* The SpanContext that refers to a parent span, if any.
13+
* A null value indicates that this should be a new root span,
14+
* rather than potentially detecting a span via a context manager.
15+
*/
16+
parent?: SpanContext | null;
17+
/**
18+
* Attributes to set on the Span
19+
*/
20+
attributes?: {
21+
[key: string]: unknown;
22+
};
23+
}
24+
25+
/**
26+
* A light interface that tries to be structurally compatible with OpenTelemetry.
27+
*/
28+
export declare interface SpanContext {
29+
/**
30+
* UUID of a trace.
31+
*/
32+
traceId: string;
33+
/**
34+
* UUID of a Span.
35+
*/
36+
spanId: string;
37+
/**
38+
* https://www.w3.org/TR/trace-context/#trace-flags
39+
*/
40+
traceFlags: number;
41+
}

0 commit comments

Comments
 (0)