@azure/core-tracing 1.0.0-dev.20200807.1 → 1.0.0-preview.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/README.md +16 -34
- package/dist/index.js +279 -377
- package/dist/index.js.map +1 -1
- package/dist-esm/src/createSpan.js +45 -0
- package/dist-esm/src/createSpan.js.map +1 -0
- package/dist-esm/src/index.js +3 -2
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/interfaces.js +85 -0
- package/dist-esm/src/interfaces.js.map +1 -1
- package/dist-esm/src/tracerProxy.js +4 -4
- package/dist-esm/src/tracerProxy.js.map +1 -1
- package/dist-esm/src/tracers/noop/noOpSpan.js +37 -33
- package/dist-esm/src/tracers/noop/noOpSpan.js.map +1 -1
- package/dist-esm/src/tracers/noop/noOpTracer.js +16 -20
- package/dist-esm/src/tracers/noop/noOpTracer.js.map +1 -1
- package/dist-esm/src/tracers/test/testSpan.js +42 -49
- package/dist-esm/src/tracers/test/testSpan.js.map +1 -1
- package/dist-esm/src/tracers/test/testTracer.js +44 -64
- package/dist-esm/src/tracers/test/testTracer.js.map +1 -1
- package/dist-esm/src/utils/cache.js +11 -29
- package/dist-esm/src/utils/cache.js.map +1 -1
- package/dist-esm/src/utils/traceParentHeader.js +15 -15
- package/dist-esm/src/utils/traceParentHeader.js.map +1 -1
- package/package.json +33 -23
- package/types/core-tracing.d.ts +488 -160
- package/dist-esm/src/tracers/opencensus/openCensusSpanWrapper.js +0 -113
- package/dist-esm/src/tracers/opencensus/openCensusSpanWrapper.js.map +0 -1
- package/dist-esm/src/tracers/opencensus/openCensusTraceStateWrapper.js +0 -26
- package/dist-esm/src/tracers/opencensus/openCensusTraceStateWrapper.js.map +0 -1
- package/dist-esm/src/tracers/opencensus/openCensusTracerWrapper.js +0 -54
- package/dist-esm/src/tracers/opencensus/openCensusTracerWrapper.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
-
## 1.0.0-preview.
|
|
3
|
+
## 1.0.0-preview.12 (2021-06-30)
|
|
4
4
|
|
|
5
|
+
- Update `@opentelemetry/api` to version 1.0.0 [PR #15883](https://github.com/Azure/azure-sdk-for-js/pull/15883)
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Removed `OpenCensusSpanWrapper` and `OpenCensusTracerWrapper` from the public API. Customers using these wrappers should migrate to using `OpenTelemetry` directly. [PR #15770](https://github.com/Azure/azure-sdk-for-js/pull/15770)
|
|
10
|
+
- Update `@azure/core-tracing` to version 1.0.0-preview.12. This brings core-tracing up to date with `@opentelemetry/api@1.0.0`.
|
|
11
|
+
- `Span#context` was renamed to `Span#spanContext`. This change is supported in `@azure/core-http@1.2.7`.
|
|
12
|
+
|
|
13
|
+
## 1.0.0-preview.11 (2021-03-30)
|
|
14
|
+
|
|
15
|
+
### Breaking Changes
|
|
16
|
+
|
|
17
|
+
- Update @azure/core-tracing to version 1.0.0-preview.11. This brings core-tracing up to date with @opentelemetry/api@1.0.0-rc.0.
|
|
18
|
+
There are two scenarios that will require changes if you are using tracing:
|
|
19
|
+
- Previously, you would pass a parent span using the `OperationOptions.tracingOptions.spanOptions.parentSpan` property. This has been
|
|
20
|
+
changed so that you now specify a parent `Context` using the `OperationOptions.tracingOptions.tracingContext` property instead.
|
|
21
|
+
- The status code for Spans is no longer of type `CanonicalCode`. Instead, it's now `SpanStatusCode`, which also has a smaller range of values.
|
|
22
|
+
|
|
23
|
+
## 1.0.0-preview.10 (2021-03-04)
|
|
24
|
+
|
|
25
|
+
- Internal improvements to make future opentelemetry updates simpler.
|
|
5
26
|
|
|
6
27
|
## 1.0.0-preview.9 (2020-08-04)
|
|
7
28
|
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ npm install @azure/core-tracing
|
|
|
14
14
|
|
|
15
15
|
## Key Concepts
|
|
16
16
|
|
|
17
|
-
The `@azure/core-tracing` package supports enabling tracing for Azure SDK packages, using an [OpenTelemetry](https://opentelemetry.io/) `Tracer`.
|
|
17
|
+
The `@azure/core-tracing` package supports enabling tracing for Azure SDK packages, using an [OpenTelemetry](https://opentelemetry.io/) `Tracer`.
|
|
18
18
|
|
|
19
19
|
By default, all libraries log with a `NoOpTracer` that takes no action.
|
|
20
20
|
To change this, you have to use `setTracer` to set a new default `Tracer`.
|
|
@@ -24,7 +24,7 @@ To change this, you have to use `setTracer` to set a new default `Tracer`.
|
|
|
24
24
|
### Example 1 - Setting an OpenTelemetry Tracer
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
|
-
const opentelemetry = require("@opentelemetry/
|
|
27
|
+
const opentelemetry = require("@opentelemetry/api");
|
|
28
28
|
const { BasicTracer, SimpleSpanProcessor } = require("@opentelemetry/tracing");
|
|
29
29
|
const { ZipkinExporter } = require("@opentelemetry/exporter-zipkin");
|
|
30
30
|
const { setTracer } = require("@azure/core-tracing");
|
|
@@ -35,9 +35,10 @@ const exporter = new ZipkinExporter({
|
|
|
35
35
|
const tracer = new BasicTracer();
|
|
36
36
|
tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
setTracer(tracer);
|
|
39
39
|
|
|
40
|
-
const rootSpan =
|
|
40
|
+
const rootSpan = tracer.startSpan("root");
|
|
41
|
+
const context = opentelemetry.setSpan(opentelemetry.context.active(), rootSpan);
|
|
41
42
|
|
|
42
43
|
// Call some client library methods and pass rootSpan via tracingOptions.
|
|
43
44
|
|
|
@@ -45,46 +46,27 @@ rootSpan.end();
|
|
|
45
46
|
exporter.shutdown();
|
|
46
47
|
```
|
|
47
48
|
|
|
48
|
-
### Example 2 -
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
const tracing = require("@opencensus/nodejs");
|
|
52
|
-
const { ZipkinTraceExporter } = require("@opencensus/exporter-zipkin");
|
|
53
|
-
const {
|
|
54
|
-
setTracer,
|
|
55
|
-
OpenCensusTracerWrapper,
|
|
56
|
-
OpenCensusSpanWrapper
|
|
57
|
-
} = require("@azure/core-tracing");
|
|
58
|
-
|
|
59
|
-
const tracer = tracing.start({ samplingRate: 1 }).tracer;
|
|
60
|
-
|
|
61
|
-
tracer.registerSpanEventListener(
|
|
62
|
-
new ZipkinTraceExporter({
|
|
63
|
-
serviceName: "azure-tracing-sample",
|
|
64
|
-
bufferTimeout: 2
|
|
65
|
-
})
|
|
66
|
-
);
|
|
67
|
-
setTracer(new OpenCensusTracerWrapper(tracer));
|
|
68
|
-
tracer.startRootSpan({ name: "root" }, async (rootSpanEx) => {
|
|
69
|
-
const rootSpan = new OpenCensusSpanWrapper(rootSpanEx);
|
|
70
|
-
// Call some client library methods and pass rootSpan via tracingOptions.
|
|
71
|
-
rootSpanEx.end(); // rootSpan.end() should work as well
|
|
72
|
-
});
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Example 3 - Passing parent Spans to library operations
|
|
49
|
+
### Example 2 - Passing current Context to library operations
|
|
76
50
|
|
|
77
51
|
```js
|
|
78
52
|
// Given a BlobClient from @azure/storage-blob
|
|
79
53
|
const result = await blobClient.download(undefined, undefined, {
|
|
80
54
|
tracingOptions: {
|
|
81
|
-
|
|
55
|
+
tracingContext: context
|
|
82
56
|
}
|
|
83
57
|
});
|
|
84
58
|
```
|
|
85
59
|
|
|
60
|
+
## Next steps
|
|
61
|
+
|
|
62
|
+
You can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes.
|
|
63
|
+
|
|
64
|
+
## Troubleshooting
|
|
65
|
+
|
|
66
|
+
If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).
|
|
67
|
+
|
|
86
68
|
## Contributing
|
|
87
69
|
|
|
88
|
-
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/
|
|
70
|
+
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
|
|
89
71
|
|
|
90
72
|

|