@azure/core-tracing
Advanced tools
Comparing version 1.0.0-preview.1 to 1.0.0-preview.2
@@ -12,2 +12,27 @@ (function (global, factory) { | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
/** | ||
* @ignore | ||
* @internal | ||
*/ | ||
var OpenCensusTraceStatePlugin = /** @class */ (function () { | ||
function OpenCensusTraceStatePlugin(state) { | ||
this._state = state; | ||
} | ||
OpenCensusTraceStatePlugin.prototype.get = function (key) { | ||
throw new Error("Method not implemented."); | ||
}; | ||
OpenCensusTraceStatePlugin.prototype.set = function (key, value) { | ||
throw new Error("Method not implemented."); | ||
}; | ||
OpenCensusTraceStatePlugin.prototype.unset = function (key) { | ||
throw new Error("Method not implemented"); | ||
}; | ||
OpenCensusTraceStatePlugin.prototype.serialize = function () { | ||
return this._state || ""; | ||
}; | ||
return OpenCensusTraceStatePlugin; | ||
}()); | ||
var OpenCensusSpanPlugin = /** @class */ (function () { | ||
@@ -27,3 +52,9 @@ function OpenCensusSpanPlugin(span) { | ||
OpenCensusSpanPlugin.prototype.context = function () { | ||
throw new Error("Method not implemented."); | ||
var openCensusSpanContext = this._span.spanContext; | ||
return { | ||
spanId: openCensusSpanContext.spanId, | ||
traceId: openCensusSpanContext.traceId, | ||
traceOptions: openCensusSpanContext.options, | ||
traceState: new OpenCensusTraceStatePlugin(openCensusSpanContext.traceState) | ||
}; | ||
}; | ||
@@ -102,3 +133,6 @@ OpenCensusSpanPlugin.prototype.setAttribute = function (key, value) { | ||
NoOpSpanPlugin.prototype.context = function () { | ||
throw new Error("Method not implemented."); | ||
return { | ||
spanId: "", | ||
traceId: "" | ||
}; | ||
}; | ||
@@ -105,0 +139,0 @@ NoOpSpanPlugin.prototype.end = function (endTime) { |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).Azure=t.Azure||{},t.Azure.Core=t.Azure.Core||{},t.Azure.Core.Tracing={}))}(this,function(t){"use strict";var e;(e=t.SupportedPlugins||(t.SupportedPlugins={}))[e.OPENCENSUS=0]="OPENCENSUS",e[e.NOOP=1]="NOOP";var n,o,r,p=function(){function t(t){this._span=t}return t.prototype.getSpan=function(){return this._span},t.prototype.end=function(t){this._span.end(t)},t.prototype.start=function(t){this._span.start(t)},t.prototype.context=function(){throw new Error("Method not implemented.")},t.prototype.setAttribute=function(t,e){return this._span.addAttribute(t,e),this},t.prototype.setAttributes=function(t){throw new Error("Method not implemented.")},t.prototype.addEvent=function(t,e){throw new Error("Method not implemented.")},t.prototype.addLink=function(t,e){return this._span.addLink(t.traceId,t.spanId,0,e),this},t.prototype.setStatus=function(t){return this._span.setStatus(t.code,t.message),this},t.prototype.updateName=function(t){throw new Error("Method not implemented.")},t.prototype.isRecordingEvents=function(){throw new Error("Method not implemented.")},t}(),i=function(){function e(e){this.pluginType=t.SupportedPlugins.OPENCENSUS,this._tracer=e}return e.prototype.startSpan=function(t,e){var n=e&&e.parent?e.parent instanceof p?e.parent.getSpan():e.parent:void 0,o=this._tracer.startChildSpan({name:t,childOf:n});return new p(o)},e.prototype.getCurrentSpan=function(){throw new Error("Method not implemented.")},e.prototype.withSpan=function(t,e){throw new Error("Method not implemented.")},e.prototype.recordSpanData=function(t){throw new Error("Method not implemented.")},e.prototype.getBinaryFormat=function(){throw new Error("Method not implemented.")},e.prototype.getHttpTextFormat=function(){throw new Error("Method not implemented.")},e}(),u=function(){function t(t){this._span=t}return t.prototype.context=function(){throw new Error("Method not implemented.")},t.prototype.end=function(t){this._span.end(t)},t.prototype.start=function(t){this._span.start(t)},t.prototype.setAttribute=function(t,e){throw new Error("Method not implemented.")},t.prototype.setAttributes=function(t){throw new Error("Method not implemented.")},t.prototype.addEvent=function(t,e){throw new Error("Method not implemented.")},t.prototype.addLink=function(t,e){throw new Error("Method not implemented.")},t.prototype.setStatus=function(t){throw new Error("Method not implemented.")},t.prototype.updateName=function(t){throw new Error("Method not implemented.")},t.prototype.isRecordingEvents=function(){throw new Error("Method not implemented.")},t}(),d=function(){function t(){}return t.prototype.context=function(){throw new Error("Method not implemented.")},t.prototype.setAttribute=function(t,e){throw new Error("Method not implemented.")},t.prototype.setAttributes=function(t){throw new Error("Method not implemented.")},t.prototype.addEvent=function(t,e){throw new Error("Method not implemented.")},t.prototype.addLink=function(t,e){throw new Error("Method not implemented.")},t.prototype.setStatus=function(t){throw new Error("Method not implemented.")},t.prototype.updateName=function(t){throw new Error("Method not implemented.")},t.prototype.start=function(t){},t.prototype.end=function(t){},t.prototype.isRecordingEvents=function(){throw new Error("Method not implemented.")},t}(),E=function(){function e(e){this.pluginType=t.SupportedPlugins.NOOP,this._tracer=e}return e.prototype.startSpan=function(t,e){var n=new d;return new u(n)},e.prototype.getCurrentSpan=function(){throw new Error("Method not implemented.")},e.prototype.withSpan=function(t,e){throw new Error("Method not implemented.")},e.prototype.recordSpanData=function(t){throw new Error("Method not implemented.")},e.prototype.getBinaryFormat=function(){throw new Error("Method not implemented.")},e.prototype.getHttpTextFormat=function(){throw new Error("Method not implemented.")},e}(),a=function(){function e(){this.pluginType=t.SupportedPlugins.NOOP}return e.prototype.getCurrentSpan=function(){throw new Error("Method not implemented.")},e.prototype.startSpan=function(t,e){return new d},e.prototype.withSpan=function(t,e){throw new Error("Method not implemented.")},e.prototype.recordSpanData=function(t){throw new Error("Method not implemented.")},e.prototype.getBinaryFormat=function(){throw new Error("Method not implemented.")},e.prototype.getHttpTextFormat=function(){throw new Error("Method not implemented.")},e}(),c=function(){function e(){}return e.setTracer=function(n,o){o===t.SupportedPlugins.OPENCENSUS?e._tracerPlugin=new i(n):e._tracerPlugin=new E(n)},e.getTracer=function(){return e._tracerPlugin||(e._tracerPlugin=new E(new a)),e._tracerPlugin},e}();(n=t.SpanKind||(t.SpanKind={}))[n.INTERNAL=0]="INTERNAL",n[n.SERVER=1]="SERVER",n[n.CLIENT=2]="CLIENT",n[n.PRODUCER=3]="PRODUCER",n[n.CONSUMER=4]="CONSUMER",(o=t.CanonicalCode||(t.CanonicalCode={}))[o.OK=0]="OK",o[o.CANCELLED=1]="CANCELLED",o[o.UNKNOWN=2]="UNKNOWN",o[o.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",o[o.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",o[o.NOT_FOUND=5]="NOT_FOUND",o[o.ALREADY_EXISTS=6]="ALREADY_EXISTS",o[o.PERMISSION_DENIED=7]="PERMISSION_DENIED",o[o.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",o[o.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",o[o.ABORTED=10]="ABORTED",o[o.OUT_OF_RANGE=11]="OUT_OF_RANGE",o[o.UNIMPLEMENTED=12]="UNIMPLEMENTED",o[o.INTERNAL=13]="INTERNAL",o[o.UNAVAILABLE=14]="UNAVAILABLE",o[o.DATA_LOSS=15]="DATA_LOSS",o[o.UNAUTHENTICATED=16]="UNAUTHENTICATED",(r=t.TraceOptions||(t.TraceOptions={}))[r.UNSAMPLED=0]="UNSAMPLED",r[r.SAMPLED=1]="SAMPLED",t.NoOpSpanPlugin=u,t.NoOpTracePlugin=E,t.OpenCensusSpanPlugin=p,t.OpenCensusTracePlugin=i,t.SpanNoOpImpl=d,t.TracerNoOpImpl=a,t.TracerProxy=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).Azure=t.Azure||{},t.Azure.Core=t.Azure.Core||{},t.Azure.Core.Tracing={}))}(this,function(t){"use strict";var e;(e=t.SupportedPlugins||(t.SupportedPlugins={}))[e.OPENCENSUS=0]="OPENCENSUS",e[e.NOOP=1]="NOOP";var n,o,r,p=function(){function t(t){this._state=t}return t.prototype.get=function(t){throw new Error("Method not implemented.")},t.prototype.set=function(t,e){throw new Error("Method not implemented.")},t.prototype.unset=function(t){throw new Error("Method not implemented")},t.prototype.serialize=function(){return this._state||""},t}(),i=function(){function t(t){this._span=t}return t.prototype.getSpan=function(){return this._span},t.prototype.end=function(t){this._span.end(t)},t.prototype.start=function(t){this._span.start(t)},t.prototype.context=function(){var t=this._span.spanContext;return{spanId:t.spanId,traceId:t.traceId,traceOptions:t.options,traceState:new p(t.traceState)}},t.prototype.setAttribute=function(t,e){return this._span.addAttribute(t,e),this},t.prototype.setAttributes=function(t){throw new Error("Method not implemented.")},t.prototype.addEvent=function(t,e){throw new Error("Method not implemented.")},t.prototype.addLink=function(t,e){return this._span.addLink(t.traceId,t.spanId,0,e),this},t.prototype.setStatus=function(t){return this._span.setStatus(t.code,t.message),this},t.prototype.updateName=function(t){throw new Error("Method not implemented.")},t.prototype.isRecordingEvents=function(){throw new Error("Method not implemented.")},t}(),u=function(){function e(e){this.pluginType=t.SupportedPlugins.OPENCENSUS,this._tracer=e}return e.prototype.startSpan=function(t,e){var n=e&&e.parent?e.parent instanceof i?e.parent.getSpan():e.parent:void 0,o=this._tracer.startChildSpan({name:t,childOf:n});return new i(o)},e.prototype.getCurrentSpan=function(){throw new Error("Method not implemented.")},e.prototype.withSpan=function(t,e){throw new Error("Method not implemented.")},e.prototype.recordSpanData=function(t){throw new Error("Method not implemented.")},e.prototype.getBinaryFormat=function(){throw new Error("Method not implemented.")},e.prototype.getHttpTextFormat=function(){throw new Error("Method not implemented.")},e}(),d=function(){function t(t){this._span=t}return t.prototype.context=function(){return{spanId:"",traceId:""}},t.prototype.end=function(t){this._span.end(t)},t.prototype.start=function(t){this._span.start(t)},t.prototype.setAttribute=function(t,e){throw new Error("Method not implemented.")},t.prototype.setAttributes=function(t){throw new Error("Method not implemented.")},t.prototype.addEvent=function(t,e){throw new Error("Method not implemented.")},t.prototype.addLink=function(t,e){throw new Error("Method not implemented.")},t.prototype.setStatus=function(t){throw new Error("Method not implemented.")},t.prototype.updateName=function(t){throw new Error("Method not implemented.")},t.prototype.isRecordingEvents=function(){throw new Error("Method not implemented.")},t}(),a=function(){function t(){}return t.prototype.context=function(){throw new Error("Method not implemented.")},t.prototype.setAttribute=function(t,e){throw new Error("Method not implemented.")},t.prototype.setAttributes=function(t){throw new Error("Method not implemented.")},t.prototype.addEvent=function(t,e){throw new Error("Method not implemented.")},t.prototype.addLink=function(t,e){throw new Error("Method not implemented.")},t.prototype.setStatus=function(t){throw new Error("Method not implemented.")},t.prototype.updateName=function(t){throw new Error("Method not implemented.")},t.prototype.start=function(t){},t.prototype.end=function(t){},t.prototype.isRecordingEvents=function(){throw new Error("Method not implemented.")},t}(),E=function(){function e(e){this.pluginType=t.SupportedPlugins.NOOP,this._tracer=e}return e.prototype.startSpan=function(t,e){var n=new a;return new d(n)},e.prototype.getCurrentSpan=function(){throw new Error("Method not implemented.")},e.prototype.withSpan=function(t,e){throw new Error("Method not implemented.")},e.prototype.recordSpanData=function(t){throw new Error("Method not implemented.")},e.prototype.getBinaryFormat=function(){throw new Error("Method not implemented.")},e.prototype.getHttpTextFormat=function(){throw new Error("Method not implemented.")},e}(),c=function(){function e(){this.pluginType=t.SupportedPlugins.NOOP}return e.prototype.getCurrentSpan=function(){throw new Error("Method not implemented.")},e.prototype.startSpan=function(t,e){return new a},e.prototype.withSpan=function(t,e){throw new Error("Method not implemented.")},e.prototype.recordSpanData=function(t){throw new Error("Method not implemented.")},e.prototype.getBinaryFormat=function(){throw new Error("Method not implemented.")},e.prototype.getHttpTextFormat=function(){throw new Error("Method not implemented.")},e}(),h=function(){function e(){}return e.setTracer=function(n,o){o===t.SupportedPlugins.OPENCENSUS?e._tracerPlugin=new u(n):e._tracerPlugin=new E(n)},e.getTracer=function(){return e._tracerPlugin||(e._tracerPlugin=new E(new c)),e._tracerPlugin},e}();(n=t.SpanKind||(t.SpanKind={}))[n.INTERNAL=0]="INTERNAL",n[n.SERVER=1]="SERVER",n[n.CLIENT=2]="CLIENT",n[n.PRODUCER=3]="PRODUCER",n[n.CONSUMER=4]="CONSUMER",(o=t.CanonicalCode||(t.CanonicalCode={}))[o.OK=0]="OK",o[o.CANCELLED=1]="CANCELLED",o[o.UNKNOWN=2]="UNKNOWN",o[o.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",o[o.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",o[o.NOT_FOUND=5]="NOT_FOUND",o[o.ALREADY_EXISTS=6]="ALREADY_EXISTS",o[o.PERMISSION_DENIED=7]="PERMISSION_DENIED",o[o.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",o[o.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",o[o.ABORTED=10]="ABORTED",o[o.OUT_OF_RANGE=11]="OUT_OF_RANGE",o[o.UNIMPLEMENTED=12]="UNIMPLEMENTED",o[o.INTERNAL=13]="INTERNAL",o[o.UNAVAILABLE=14]="UNAVAILABLE",o[o.DATA_LOSS=15]="DATA_LOSS",o[o.UNAUTHENTICATED=16]="UNAUTHENTICATED",(r=t.TraceOptions||(t.TraceOptions={}))[r.UNSAMPLED=0]="UNSAMPLED",r[r.SAMPLED=1]="SAMPLED",t.NoOpSpanPlugin=d,t.NoOpTracePlugin=E,t.OpenCensusSpanPlugin=i,t.OpenCensusTracePlugin=u,t.SpanNoOpImpl=a,t.TracerNoOpImpl=c,t.TracerProxy=h,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=core-tracing.min.js.map |
@@ -0,3 +1,8 @@ | ||
# 1.0.0-preview.2 9th September 2019 | ||
Updated the `OpenCensusSpanPlugin` & the `NoOpSpanPlugin` to support for retrieving span context. This allows updating of request headers with the right [span context](https://www.w3.org/TR/trace-context/#trace-context-http-headers-format). (PR [#4712](https://github.com/Azure/azure-sdk-for-js/pull/4712)) | ||
# 1.0.0-preview.1 5th August 2019 | ||
Provides low-level interfaces and helper methods for tracing in Azure SDK |
@@ -6,3 +6,6 @@ var NoOpSpanPlugin = /** @class */ (function () { | ||
NoOpSpanPlugin.prototype.context = function () { | ||
throw new Error("Method not implemented."); | ||
return { | ||
spanId: "", | ||
traceId: "" | ||
}; | ||
}; | ||
@@ -9,0 +12,0 @@ NoOpSpanPlugin.prototype.end = function (endTime) { |
@@ -0,1 +1,2 @@ | ||
import { OpenCensusTraceStatePlugin } from "./openCensusTraceStatePlugin"; | ||
var OpenCensusSpanPlugin = /** @class */ (function () { | ||
@@ -15,3 +16,9 @@ function OpenCensusSpanPlugin(span) { | ||
OpenCensusSpanPlugin.prototype.context = function () { | ||
throw new Error("Method not implemented."); | ||
var openCensusSpanContext = this._span.spanContext; | ||
return { | ||
spanId: openCensusSpanContext.spanId, | ||
traceId: openCensusSpanContext.traceId, | ||
traceOptions: openCensusSpanContext.options, | ||
traceState: new OpenCensusTraceStatePlugin(openCensusSpanContext.traceState) | ||
}; | ||
}; | ||
@@ -18,0 +25,0 @@ OpenCensusSpanPlugin.prototype.setAttribute = function (key, value) { |
@@ -10,2 +10,27 @@ 'use strict'; | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
/** | ||
* @ignore | ||
* @internal | ||
*/ | ||
var OpenCensusTraceStatePlugin = /** @class */ (function () { | ||
function OpenCensusTraceStatePlugin(state) { | ||
this._state = state; | ||
} | ||
OpenCensusTraceStatePlugin.prototype.get = function (key) { | ||
throw new Error("Method not implemented."); | ||
}; | ||
OpenCensusTraceStatePlugin.prototype.set = function (key, value) { | ||
throw new Error("Method not implemented."); | ||
}; | ||
OpenCensusTraceStatePlugin.prototype.unset = function (key) { | ||
throw new Error("Method not implemented"); | ||
}; | ||
OpenCensusTraceStatePlugin.prototype.serialize = function () { | ||
return this._state || ""; | ||
}; | ||
return OpenCensusTraceStatePlugin; | ||
}()); | ||
var OpenCensusSpanPlugin = /** @class */ (function () { | ||
@@ -25,3 +50,9 @@ function OpenCensusSpanPlugin(span) { | ||
OpenCensusSpanPlugin.prototype.context = function () { | ||
throw new Error("Method not implemented."); | ||
var openCensusSpanContext = this._span.spanContext; | ||
return { | ||
spanId: openCensusSpanContext.spanId, | ||
traceId: openCensusSpanContext.traceId, | ||
traceOptions: openCensusSpanContext.options, | ||
traceState: new OpenCensusTraceStatePlugin(openCensusSpanContext.traceState) | ||
}; | ||
}; | ||
@@ -100,3 +131,6 @@ OpenCensusSpanPlugin.prototype.setAttribute = function (key, value) { | ||
NoOpSpanPlugin.prototype.context = function () { | ||
throw new Error("Method not implemented."); | ||
return { | ||
spanId: "", | ||
traceId: "" | ||
}; | ||
}; | ||
@@ -103,0 +137,0 @@ NoOpSpanPlugin.prototype.end = function (endTime) { |
{ | ||
"name": "@azure/core-tracing", | ||
"version": "1.0.0-preview.1", | ||
"version": "1.0.0-preview.2", | ||
"description": "Provides low-level interfaces and helper methods for tracing in Azure SDK", | ||
@@ -27,3 +27,3 @@ "sdk-type": "client", | ||
"lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c ../../.eslintrc.json --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint -c ../../.eslintrc.json lib --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o template-lintReport.html || exit 0", | ||
"lint": "eslint -c ../../.eslintrc.json lib --ext .ts -f html -o template-lintReport.html || exit 0", | ||
"pack": "npm pack 2>&1", | ||
@@ -57,3 +57,3 @@ "prebuild": "npm run clean", | ||
"engine": { | ||
"node": ">=6.0.0" | ||
"node": ">=8.0.0" | ||
}, | ||
@@ -69,9 +69,8 @@ "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/core/core-tracing", | ||
"@types/node": "^8.0.0", | ||
"@typescript-eslint/eslint-plugin": "^1.11.0", | ||
"@typescript-eslint/parser": "^1.11.0", | ||
"@typescript-eslint/eslint-plugin": "^2.0.0", | ||
"@typescript-eslint/parser": "^2.0.0", | ||
"assert": "^1.4.1", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.16.0", | ||
"eslint": "^6.1.0", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-detailed-reporter": "^0.8.0", | ||
"eslint-plugin-no-null": "^1.0.2", | ||
@@ -81,7 +80,7 @@ "eslint-plugin-no-only-tests": "^2.3.0", | ||
"inherits": "^2.0.3", | ||
"mocha": "^5.2.0", | ||
"mocha": "^6.2.0", | ||
"mocha-junit-reporter": "^1.18.0", | ||
"mocha-multi": "^1.0.1", | ||
"mocha-multi": "^1.1.3", | ||
"prettier": "^1.16.4", | ||
"rimraf": "^2.6.2", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.16.3", | ||
@@ -88,0 +87,0 @@ "rollup-plugin-commonjs": "^10.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
196799
29
58
2
2297