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-tracing] Update to OpenTelemetry 0.6 #7998

Merged
merged 38 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
113e8e4
Move to core-tracing to OpenTelemetry 0.5
xirzec Mar 24, 2020
513a49a
Migrate all packages to OpenTelemetry 0.5
xirzec Mar 24, 2020
4b4533c
Bump version of core-tracing
xirzec Mar 24, 2020
d7d5691
Bump cache version
xirzec Mar 24, 2020
37cb01b
Fixup changelog
xirzec Mar 25, 2020
ac2011a
Fix build breaks
xirzec Mar 25, 2020
a06d2e5
Fix named export
xirzec Mar 25, 2020
f2b1a77
Revert using OT noop
xirzec Mar 25, 2020
8e455ba
fix build break
xirzec Mar 25, 2020
3f4d0f4
Merge remote-tracking branch 'upstream/master' into OT05
xirzec Mar 26, 2020
3bb121d
update lockfil
xirzec Mar 26, 2020
2b85d20
Create new tracing interfaces
xirzec Mar 27, 2020
f508508
Try to adopt
xirzec Mar 27, 2020
15d6c1c
Fix build breaks
xirzec Mar 27, 2020
2109b5b
Merge remote-tracking branch 'upstream/master' into OT05
xirzec Mar 27, 2020
e2d872b
Update lockfile
xirzec Mar 27, 2020
5fa208d
Merge remote-tracking branch 'upstream/master' into OT05
xirzec Mar 27, 2020
ad0301d
Update lockfile
xirzec Mar 28, 2020
7cb934f
Merge branch 'master' into OT05
xirzec Mar 28, 2020
5d40a9b
Merge branch 'master' into OT05
xirzec Mar 30, 2020
04e4699
Update lockfile
xirzec Mar 30, 2020
4b49cf7
Fix test break
xirzec Mar 30, 2020
d203333
Merge remote-tracking branch 'upstream/master' into OT05
xirzec Apr 16, 2020
e53ce32
fixup
xirzec Apr 16, 2020
3bbb73c
update lockfile
xirzec Apr 16, 2020
b04875e
Fix identity and search
xirzec Apr 16, 2020
76c875a
Fix form recognizer
xirzec Apr 16, 2020
d96896b
Update min version of core-http
xirzec Apr 17, 2020
00be357
Update to OpenTelemetry 0.6.1
xirzec Apr 17, 2020
3fee5c8
Merge remote-tracking branch 'origin' into pr/xirzec/7998
ramya-rao-a Apr 20, 2020
a01b8eb
Update sdk/core/core-tracing/CHANGELOG.md
xirzec Apr 21, 2020
0831e8b
Update sdk/core/core-tracing/src/utils/cache.ts
xirzec Apr 21, 2020
938ea38
Merge remote-tracking branch 'upstream/master' into OT05
xirzec Apr 22, 2020
1ed0928
Fix merge conflicts
xirzec Apr 22, 2020
e09ff90
Fix broken eventhubs test
xirzec Apr 22, 2020
bd0a000
Ensure datalake depends on latest blob
xirzec Apr 23, 2020
3aed715
Merge remote-tracking branch 'upstream/master' into OT05
xirzec Apr 23, 2020
ab0796a
Update deps
xirzec Apr 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 60 additions & 27 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-http": "^1.0.0",
"@azure/core-paging": "^1.1.0",
"@azure/core-tracing": "1.0.0-preview.7",
"@opentelemetry/types": "^0.2.0",
"@azure/core-tracing": "1.0.0-preview.8",
"@opentelemetry/api": "^0.5.1",
"tslib": "^1.10.0"
},
"devDependencies": {
"@azure/identity": "1.1.0-preview1",
"@azure/identity": "1.1.0-preview.2",
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
"@microsoft/api-extractor": "^7.5.4",
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-multi-entry": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { getTracer } from "@azure/core-tracing";
import { Span, SpanOptions, SpanKind, CanonicalCode } from "@opentelemetry/types";
import { Span, SpanOptions, SpanKind, CanonicalCode } from "@opentelemetry/api";

import { RestError } from "@azure/core-http";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { Spanner } from "../src/internal/tracingHelpers";
import { RestError } from "@azure/core-http";
import { getTracer } from "@azure/core-tracing";
import { SpanOptions, SpanKind, CanonicalCode } from "@opentelemetry/types";
import { SpanOptions, SpanKind, CanonicalCode } from "@opentelemetry/api";
import * as assert from "assert";

interface FakeOptions {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"devDependencies": {
"@azure/eslint-plugin-azure-sdk": "^2.0.1",
"@azure/identity": "1.1.0-preview1",
"@azure/identity": "1.1.0-preview.2",
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-inject": "^4.0.0",
"@rollup/plugin-json": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"sideEffects": false,
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-tracing": "1.0.0-preview.7",
"@opentelemetry/types": "^0.2.0",
"@azure/core-tracing": "1.0.0-preview.8",
"@opentelemetry/api": "^0.5.1",
"tslib": "^1.10.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-auth/review/core-auth.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```ts

import { AbortSignalLike } from '@azure/abort-controller';
import { SpanOptions } from '@opentelemetry/types';
import { SpanOptions } from '@opentelemetry/api';

export { AbortSignalLike }

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-auth/src/operationOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { AbortSignalLike } from "@azure/abort-controller";
import { SpanOptions } from "@opentelemetry/types";
import { SpanOptions } from "@opentelemetry/api";

/**
* The base options type for all operations.
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.0.0",
"@azure/core-tracing": "1.0.0-preview.7",
"@azure/core-tracing": "1.0.0-preview.8",
"@azure/logger": "^1.0.0",
"@opentelemetry/types": "^0.2.0",
"@opentelemetry/api": "^0.5.1",
"@types/node-fetch": "^2.5.0",
"@types/tunnel": "^0.0.1",
"cross-env": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function browserConfig(test = false, production = false) {
namedExports: {
chai: ["assert", "AssertionError", "should", "expect"],
events: ["EventEmitter"],
"@opentelemetry/types": ["CanonicalCode", "SpanKind", "TraceFlags"]
"@opentelemetry/api": ["CanonicalCode", "SpanKind", "TraceFlags"]
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
}
}),
viz({ filename: "dist-browser/browser-stats.html", sourcemap: false })
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/src/operationOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AbortSignalLike } from "@azure/abort-controller";
import { SpanOptions } from "@opentelemetry/types";
import { SpanOptions } from "@opentelemetry/api";
import { TransferProgressEvent, RequestOptionsBase } from "./webResource";

/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/src/policies/tracingPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { getTracer, getTraceParentHeader } from "@azure/core-tracing";
import { SpanOptions, SpanKind } from "@opentelemetry/types";
import { SpanOptions, SpanKind } from "@opentelemetry/api";
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
import {
RequestPolicyFactory,
RequestPolicy,
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/src/webResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { HttpOperationResponse } from "./httpOperationResponse";
import { OperationResponse } from "./operationResponse";
import { ProxySettings } from "./serviceClient";
import { AbortSignalLike } from "@azure/abort-controller";
import { SpanOptions } from "@opentelemetry/types";
import { SpanOptions } from "@opentelemetry/api";

export type HttpMethods =
| "GET"
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-http/test/policies/tracingPolicyTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
HttpHeaders,
RequestPolicyOptions
} from "../../src/coreHttp";
import { SpanOptions, SpanContext, TraceFlags } from "@opentelemetry/types";
import { SpanOptions, SpanContext, TraceFlags } from "@opentelemetry/api";
import { setTracer, NoOpTracer, NoOpSpan } from "@azure/core-tracing";
import { tracingPolicy } from "../../src/policies/tracingPolicy";

Expand Down Expand Up @@ -60,7 +60,7 @@ class MockTracer extends NoOpTracer {
constructor(
private traceId = "",
private spanId = "",
private flags = TraceFlags.UNSAMPLED,
private flags = TraceFlags.NONE,
private state = ""
) {
super();
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-lro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-http": "^1.0.0",
"@opentelemetry/types": "^0.2.0",
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
"@opentelemetry/api": "^0.5.1",
"events": "^3.0.0",
"tslib": "^1.10.0"
},
"devDependencies": {
"@azure/core-arm": "1.0.0-preview.7",
"@azure/identity": "1.1.0-preview1",
"@azure/identity": "1.1.0-preview.2",
"@microsoft/api-extractor": "^7.5.4",
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-multi-entry": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-lro/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function browserConfig(test = false) {
cjs({
namedExports: {
assert: ["ok", "equal", "strictEqual"],
"@opentelemetry/types": ["CanonicalCode", "SpanKind", "TraceFlags"]
"@opentelemetry/api": ["CanonicalCode", "SpanKind", "TraceFlags"]
}
})
]
Expand Down
5 changes: 5 additions & 0 deletions sdk/core/core-tracing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## 1.0.0-preview.8 (Unreleased)

- Update `TestSpan` to allow setting span attributes [PR link](https://github.com/Azure/azure-sdk-for-js/pull/6565).
- [BREAKING] Migrate to OpenTelemetry 0.5 using the new `@opentelemetry/api` package. There were a few breaking changes:
xirzec marked this conversation as resolved.
Show resolved Hide resolved
- `SpanContext` now requires traceFlags to be set.
- `Tracer` has removed `recordSpanData`, `getBinaryFormat`, and `getHttpTextFormat`.
- `Tracer.getCurrentSpan` returns `undefined` instead of `null` when unset.
- `Link` objects renamed `spanContext` property to `context`.

## 1.0.0-preview.7 (2019-12-03)

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"sideEffects": false,
"dependencies": {
"@opencensus/web-types": "0.0.7",
"@opentelemetry/types": "^0.2.0",
"@opentelemetry/api": "^0.5.1",
"tslib": "^1.10.0"
},
"devDependencies": {
Expand Down
26 changes: 9 additions & 17 deletions sdk/core/core-tracing/review/core-tracing.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@

```ts

import { Attributes } from '@opentelemetry/types';
import { BinaryFormat } from '@opentelemetry/types';
import { HttpTextFormat } from '@opentelemetry/types';
import { Attributes } from '@opentelemetry/api';
import { Span as OpenCensusSpan } from '@opencensus/web-types';
import { Tracer as OpenCensusTracer } from '@opencensus/web-types';
import { Span } from '@opentelemetry/types';
import { SpanContext } from '@opentelemetry/types';
import { SpanKind } from '@opentelemetry/types';
import { SpanOptions } from '@opentelemetry/types';
import { Status } from '@opentelemetry/types';
import { TimeInput } from '@opentelemetry/types';
import { Tracer } from '@opentelemetry/types';
import { Span } from '@opentelemetry/api';
import { SpanContext } from '@opentelemetry/api';
import { SpanKind } from '@opentelemetry/api';
import { SpanOptions } from '@opentelemetry/api';
import { Status } from '@opentelemetry/api';
import { TimeInput } from '@opentelemetry/api';
import { Tracer } from '@opentelemetry/api';
import { TracerBase } from '@opencensus/web-types';

// @public
Expand All @@ -42,10 +40,7 @@ export class NoOpSpan implements Span {
// @public
export class NoOpTracer implements Tracer {
bind<T>(target: T, _span?: Span): T;
getBinaryFormat(): BinaryFormat;
getCurrentSpan(): Span;
getHttpTextFormat(): HttpTextFormat;
recordSpanData(_span: Span): void;
startSpan(_name: string, _options?: SpanOptions): Span;
withSpan<T extends (...args: unknown[]) => ReturnType<T>>(_span: Span, fn: T): ReturnType<T>;
}
Expand Down Expand Up @@ -73,11 +68,8 @@ export { OpenCensusTracer }
export class OpenCensusTracerWrapper implements Tracer {
constructor(tracer: TracerBase);
bind<T>(_target: T, _span?: Span): T;
getBinaryFormat(): BinaryFormat;
getCurrentSpan(): Span | null;
getHttpTextFormat(): HttpTextFormat;
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
getCurrentSpan(): Span | undefined;
getWrappedTracer(): TracerBase;
recordSpanData(_span: Span): void;
startSpan(name: string, options?: SpanOptions): Span;
withSpan<T extends (...args: unknown[]) => unknown>(_span: Span, _fn: T): ReturnType<T>;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function browserConfig(test = false) {
}),
cjs({
namedExports: {
"@opentelemetry/types": ["CanonicalCode", "SpanKind", "TraceFlags"],
"@opentelemetry/api": ["CanonicalCode", "SpanKind", "TraceFlags"],
assert: ["ok", "fail", "equal", "deepEqual", "deepStrictEqual", "strictEqual"]
}
}),
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/src/tracerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { NoOpTracer } from "./tracers/noop/noOpTracer";
import { Tracer } from "@opentelemetry/types";
import { Tracer } from "@opentelemetry/api";
import { getCache } from "./utils/cache";

let defaultTracer: Tracer;
Expand Down
22 changes: 0 additions & 22 deletions sdk/core/core-tracing/src/tracers/noop/noOpBinaryFormat.ts

This file was deleted.

25 changes: 0 additions & 25 deletions sdk/core/core-tracing/src/tracers/noop/noOpHttpTextFormat.ts

This file was deleted.

5 changes: 3 additions & 2 deletions sdk/core/core-tracing/src/tracers/noop/noOpSpan.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Span, SpanContext, Attributes, Status } from "@opentelemetry/types";
import { Span, SpanContext, Attributes, Status, TraceFlags } from "@opentelemetry/api";

/**
* A no-op implementation of Span that can safely be used without side-effects.
Expand All @@ -12,7 +12,8 @@ export class NoOpSpan implements Span {
context(): SpanContext {
return {
spanId: "",
traceId: ""
traceId: "",
traceFlags: TraceFlags.NONE
};
}

Expand Down
26 changes: 1 addition & 25 deletions sdk/core/core-tracing/src/tracers/noop/noOpTracer.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { NoOpSpan } from "./noOpSpan";
import { BinaryFormat, HttpTextFormat, Tracer, Span, SpanOptions } from "@opentelemetry/types";
import { NoOpBinaryFormat } from "./noOpBinaryFormat";
import { NoOpHttpTextFormat } from "./noOpHttpTextFormat";
import { Tracer, Span, SpanOptions } from "@opentelemetry/api";

/**
* A no-op implementation of Tracer that can be used when tracing
Expand Down Expand Up @@ -43,26 +41,4 @@ export class NoOpTracer implements Tracer {
bind<T>(target: T, _span?: Span): T {
return target;
}

/**
* Send a pre-populated Span object to the exporter.
* @param _span The span to pass along.
*/
recordSpanData(_span: Span): void {
/* NOOP */
}

/**
* Returns the BinaryFormat interface for serializing/deserializing Spans.
*/
getBinaryFormat(): BinaryFormat {
return new NoOpBinaryFormat();
}

/**
* Returns the HttpTextFormat interface for injecting/extracting Spans.
*/
getHttpTextFormat(): HttpTextFormat {
return new NoOpHttpTextFormat();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { SpanContext, Span, SpanOptions, Attributes, Status } from "@opentelemetry/types";
import { SpanContext, Span, SpanOptions, Attributes, Status, TraceFlags } from "@opentelemetry/api";
import { OpenCensusTraceStateWrapper } from "./openCensusTraceStateWrapper";
import { OpenCensusTracerWrapper } from "./openCensusTracerWrapper";
import { Attributes as OpenCensusAttributes, Span as OpenCensusSpan } from "@opencensus/web-types";

function isWrappedSpan(span?: Span | SpanContext): span is OpenCensusSpanWrapper {
function isWrappedSpan(span?: Span | SpanContext | null): span is OpenCensusSpanWrapper {
return !!span && (span as OpenCensusSpanWrapper).getWrappedSpan !== undefined;
}

Expand Down Expand Up @@ -56,8 +56,8 @@ export class OpenCensusSpanWrapper implements Span {
for (const link of options.links) {
// Since there is no way to set the link relationship, leave it as Unspecified.
this._span.addLink(
link.spanContext.traceId,
link.spanContext.spanId,
link.context.traceId,
link.context.spanId,
0 /* LinkType.UNSPECIFIED */,
link.attributes as OpenCensusAttributes
);
Expand Down Expand Up @@ -86,7 +86,7 @@ export class OpenCensusSpanWrapper implements Span {
return {
spanId: openCensusSpanContext.spanId,
traceId: openCensusSpanContext.traceId,
traceFlags: openCensusSpanContext.options,
traceFlags: openCensusSpanContext.options as TraceFlags,
traceState: new OpenCensusTraceStateWrapper(openCensusSpanContext.traceState)
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { TraceState } from "@opentelemetry/types";
import { TraceState } from "@opentelemetry/api";

/**
* @ignore
Expand Down
Loading