@opentelemetry/api 0.13.0 → 0.14.0
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/build/src/api/propagation.d.ts +4 -4
- package/build/src/api/propagation.js +4 -8
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/{correlation_context/CorrelationContext.d.ts → baggage/Baggage.d.ts} +5 -5
- package/build/src/{trace/instrumentation/Plugin.js → baggage/Baggage.js} +1 -1
- package/build/src/baggage/Baggage.js.map +1 -0
- package/build/src/{correlation_context → baggage}/EntryValue.d.ts +0 -0
- package/build/src/{correlation_context → baggage}/EntryValue.js +0 -0
- package/build/src/baggage/EntryValue.js.map +1 -0
- package/build/src/context/context.d.ts +11 -1
- package/build/src/context/context.js +22 -2
- package/build/src/context/context.js.map +1 -1
- package/build/src/index.d.ts +2 -3
- package/build/src/index.js +2 -3
- package/build/src/index.js.map +1 -1
- package/build/src/metrics/Meter.d.ts +4 -5
- package/build/src/metrics/Metric.d.ts +5 -3
- package/build/src/metrics/Metric.js.map +1 -1
- package/build/src/metrics/NoopMeter.d.ts +6 -6
- package/build/src/metrics/NoopMeter.js +10 -12
- package/build/src/metrics/NoopMeter.js.map +1 -1
- package/build/src/trace/span_context.d.ts +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/package.json +8 -8
- package/build/src/correlation_context/CorrelationContext.js +0 -18
- package/build/src/correlation_context/CorrelationContext.js.map +0 -1
- package/build/src/correlation_context/EntryValue.js.map +0 -1
- package/build/src/trace/instrumentation/Plugin.d.ts +0 -71
- package/build/src/trace/instrumentation/Plugin.js.map +0 -1
|
@@ -16,19 +16,19 @@ export declare class PropagationAPI {
|
|
|
16
16
|
/**
|
|
17
17
|
* Inject context into a carrier to be propagated inter-process
|
|
18
18
|
*
|
|
19
|
+
* @param context Context carrying tracing data to inject
|
|
19
20
|
* @param carrier carrier to inject context into
|
|
20
21
|
* @param setter Function used to set values on the carrier
|
|
21
|
-
* @param context Context carrying tracing data to inject. Defaults to the currently active context.
|
|
22
22
|
*/
|
|
23
|
-
inject<Carrier>(carrier: Carrier, setter?: TextMapSetter<Carrier
|
|
23
|
+
inject<Carrier>(context: Context, carrier: Carrier, setter?: TextMapSetter<Carrier>): void;
|
|
24
24
|
/**
|
|
25
25
|
* Extract context from a carrier
|
|
26
26
|
*
|
|
27
|
+
* @param context Context which the newly created context will inherit from
|
|
27
28
|
* @param carrier Carrier to extract context from
|
|
28
29
|
* @param getter Function used to extract keys from a carrier
|
|
29
|
-
* @param context Context which the newly created context will inherit from. Defaults to the currently active context.
|
|
30
30
|
*/
|
|
31
|
-
extract<Carrier>(carrier: Carrier, getter?: TextMapGetter<Carrier
|
|
31
|
+
extract<Carrier>(context: Context, carrier: Carrier, getter?: TextMapGetter<Carrier>): Context;
|
|
32
32
|
/** Remove the global propagator */
|
|
33
33
|
disable(): void;
|
|
34
34
|
private _getGlobalPropagator;
|
|
@@ -18,9 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.PropagationAPI = void 0;
|
|
19
19
|
var NoopTextMapPropagator_1 = require("../context/propagation/NoopTextMapPropagator");
|
|
20
20
|
var TextMapPropagator_1 = require("../context/propagation/TextMapPropagator");
|
|
21
|
-
var context_1 = require("./context");
|
|
22
21
|
var global_utils_1 = require("./global-utils");
|
|
23
|
-
var contextApi = context_1.ContextAPI.getInstance();
|
|
24
22
|
/**
|
|
25
23
|
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
26
24
|
*/
|
|
@@ -49,25 +47,23 @@ var PropagationAPI = /** @class */ (function () {
|
|
|
49
47
|
/**
|
|
50
48
|
* Inject context into a carrier to be propagated inter-process
|
|
51
49
|
*
|
|
50
|
+
* @param context Context carrying tracing data to inject
|
|
52
51
|
* @param carrier carrier to inject context into
|
|
53
52
|
* @param setter Function used to set values on the carrier
|
|
54
|
-
* @param context Context carrying tracing data to inject. Defaults to the currently active context.
|
|
55
53
|
*/
|
|
56
|
-
PropagationAPI.prototype.inject = function (carrier, setter
|
|
54
|
+
PropagationAPI.prototype.inject = function (context, carrier, setter) {
|
|
57
55
|
if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; }
|
|
58
|
-
if (context === void 0) { context = contextApi.active(); }
|
|
59
56
|
return this._getGlobalPropagator().inject(context, carrier, setter);
|
|
60
57
|
};
|
|
61
58
|
/**
|
|
62
59
|
* Extract context from a carrier
|
|
63
60
|
*
|
|
61
|
+
* @param context Context which the newly created context will inherit from
|
|
64
62
|
* @param carrier Carrier to extract context from
|
|
65
63
|
* @param getter Function used to extract keys from a carrier
|
|
66
|
-
* @param context Context which the newly created context will inherit from. Defaults to the currently active context.
|
|
67
64
|
*/
|
|
68
|
-
PropagationAPI.prototype.extract = function (carrier, getter
|
|
65
|
+
PropagationAPI.prototype.extract = function (context, carrier, getter) {
|
|
69
66
|
if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; }
|
|
70
|
-
if (context === void 0) { context = contextApi.active(); }
|
|
71
67
|
return this._getGlobalPropagator().extract(context, carrier, getter);
|
|
72
68
|
};
|
|
73
69
|
/** Remove the global propagator */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,sFAAwF;AACxF,8EAMkD;AAClD
|
|
1
|
+
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,sFAAwF;AACxF,8EAMkD;AAClD,+CAKwB;AAExB;;GAEG;AACH;IAGE,+FAA+F;IAC/F;IAAuB,CAAC;IAExB,uDAAuD;IACzC,0BAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,4CAAmB,GAA1B,UAA2B,UAA6B;QACtD,IAAI,sBAAO,CAAC,yCAA0B,CAAC,EAAE;YACvC,yCAAyC;YACzC,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC;SACpC;QAED,sBAAO,CAAC,yCAA0B,CAAC,GAAG,yBAAU,CAC9C,kDAAmC,EACnC,UAAU,EACV,gDAAwB,CACzB,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACI,+BAAM,GAAb,UACE,OAAgB,EAChB,OAAgB,EAChB,MAAqD;QAArD,uBAAA,EAAA,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACI,gCAAO,GAAd,UACE,OAAgB,EAChB,OAAgB,EAChB,MAAqD;QAArD,uBAAA,EAAA,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED,mCAAmC;IAC5B,gCAAO,GAAd;QACE,OAAO,sBAAO,CAAC,yCAA0B,CAAC,CAAC;IAC7C,CAAC;IAEO,6CAAoB,GAA5B;;QACE,OAAO,aACL,sBAAO,CAAC,yCAA0B,CAAC,+CAAnC,sBAAO,EACL,kDAAmC,oCAChC,gDAAwB,CAC9B,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AA3ED,IA2EC;AA3EY,wCAAc"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EntryValue } from './EntryValue';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Baggage represents collection of entries. Each key of
|
|
4
|
+
* Baggage is associated with exactly one value. Baggage
|
|
5
5
|
* is serializable, to facilitate propagating it not only inside the process
|
|
6
|
-
* but also across process boundaries.
|
|
6
|
+
* but also across process boundaries. Baggage is used to annotate
|
|
7
7
|
* telemetry with the name:value pair Entry. Those values can be used to add
|
|
8
8
|
* dimension to the metric or additional contest properties to logs and traces.
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface Baggage {
|
|
11
11
|
[entryKey: string]: EntryValue;
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=Baggage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Baggage.js","sourceRoot":"","sources":["../../../src/baggage/Baggage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntryValue.js","sourceRoot":"","sources":["../../../src/baggage/EntryValue.ts"],"names":[],"mappings":";;;AAyBA;;;;GAIG;AACH,IAAY,QASX;AATD,WAAY,QAAQ;IAClB;;;OAGG;IACH,2DAAkB,CAAA;IAElB,0DAA0D;IAC1D,0EAA0B,CAAA;AAC5B,CAAC,EATW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QASnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Span, SpanContext } from '../';
|
|
2
1
|
import { Context } from '@opentelemetry/context-base';
|
|
2
|
+
import { Baggage, Span, SpanContext } from '../';
|
|
3
3
|
/**
|
|
4
4
|
* Return the active span if one exists
|
|
5
5
|
*
|
|
@@ -50,4 +50,14 @@ export declare function unsuppressInstrumentation(context: Context): Context;
|
|
|
50
50
|
* @param context context check for the suppress instrumentation value.
|
|
51
51
|
*/
|
|
52
52
|
export declare function isInstrumentationSuppressed(context: Context): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @param {Context} Context that manage all context values
|
|
55
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
56
|
+
*/
|
|
57
|
+
export declare function getBaggage(context: Context): Baggage | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* @param {Context} Context that manage all context values
|
|
60
|
+
* @param {Baggage} baggage that will be set in the actual context
|
|
61
|
+
*/
|
|
62
|
+
export declare function setBaggage(context: Context, baggage: Baggage): Context;
|
|
53
63
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getParentSpanContext = exports.setExtractedSpanContext = exports.setActiveSpan = exports.getActiveSpan = void 0;
|
|
19
|
-
var __1 = require("../");
|
|
18
|
+
exports.setBaggage = exports.getBaggage = exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getParentSpanContext = exports.setExtractedSpanContext = exports.setActiveSpan = exports.getActiveSpan = void 0;
|
|
20
19
|
var context_base_1 = require("@opentelemetry/context-base");
|
|
20
|
+
var __1 = require("../");
|
|
21
21
|
/**
|
|
22
22
|
* Active span key
|
|
23
23
|
*/
|
|
@@ -27,6 +27,10 @@ var ACTIVE_SPAN_KEY = context_base_1.createContextKey('OpenTelemetry Context Key
|
|
|
27
27
|
* this current scope.
|
|
28
28
|
*/
|
|
29
29
|
var SUPPRESS_INSTRUMENTATION_KEY = context_base_1.createContextKey('OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION');
|
|
30
|
+
/**
|
|
31
|
+
* Baggage key
|
|
32
|
+
*/
|
|
33
|
+
var BAGGAGE_KEY = context_base_1.createContextKey('OpenTelemetry Baggage Key');
|
|
30
34
|
/**
|
|
31
35
|
* Return the active span if one exists
|
|
32
36
|
*
|
|
@@ -99,4 +103,20 @@ function isInstrumentationSuppressed(context) {
|
|
|
99
103
|
return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY));
|
|
100
104
|
}
|
|
101
105
|
exports.isInstrumentationSuppressed = isInstrumentationSuppressed;
|
|
106
|
+
/**
|
|
107
|
+
* @param {Context} Context that manage all context values
|
|
108
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
109
|
+
*/
|
|
110
|
+
function getBaggage(context) {
|
|
111
|
+
return context.getValue(BAGGAGE_KEY) || undefined;
|
|
112
|
+
}
|
|
113
|
+
exports.getBaggage = getBaggage;
|
|
114
|
+
/**
|
|
115
|
+
* @param {Context} Context that manage all context values
|
|
116
|
+
* @param {Baggage} baggage that will be set in the actual context
|
|
117
|
+
*/
|
|
118
|
+
function setBaggage(context, baggage) {
|
|
119
|
+
return context.setValue(BAGGAGE_KEY, baggage);
|
|
120
|
+
}
|
|
121
|
+
exports.setBaggage = setBaggage;
|
|
102
122
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAAwE;AACxE,yBAA2D;AAE3D;;GAEG;AACH,IAAM,eAAe,GAAG,+BAAgB,CACtC,uCAAuC,CACxC,CAAC;AAEF;;;GAGG;AACH,IAAM,4BAA4B,GAAG,+BAAgB,CACnD,oDAAoD,CACrD,CAAC;AAEF;;GAEG;AACH,IAAM,WAAW,GAAG,+BAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;GAIG;AACH,SAAgB,aAAa,CAAC,OAAgB;IAC5C,OAAQ,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU,IAAI,SAAS,CAAC;AAClE,CAAC;AAFD,sCAEC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAgB,EAAE,IAAU;IACxD,OAAO,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC;AAFD,sCAEC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,OAAgB,EAChB,WAAwB;IAExB,OAAO,aAAa,CAAC,OAAO,EAAE,IAAI,YAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3D,CAAC;AALD,0DAKC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAClC,OAAgB;;IAEhB,aAAO,aAAa,CAAC,OAAO,CAAC,0CAAE,OAAO,GAAG;AAC3C,CAAC;AAJD,oDAIC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,OAAO,OAAO,CAAC,QAAQ,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC;AAFD,0DAEC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,OAAgB;IACxD,OAAO,OAAO,CAAC,QAAQ,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC;AAFD,8DAEC;AAED;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,OAAgB;IAC1D,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC,CAAC;AACjE,CAAC;AAFD,kEAEC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAFD,gCAEC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC"}
|
package/build/src/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export * from './common/Time';
|
|
|
4
4
|
export * from './context/context';
|
|
5
5
|
export * from './context/propagation/TextMapPropagator';
|
|
6
6
|
export * from './context/propagation/NoopTextMapPropagator';
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './baggage/Baggage';
|
|
8
|
+
export * from './baggage/EntryValue';
|
|
9
9
|
export * from './metrics/BatchObserverResult';
|
|
10
10
|
export * from './metrics/BoundInstrument';
|
|
11
11
|
export * from './metrics/Meter';
|
|
@@ -17,7 +17,6 @@ export * from './metrics/Observation';
|
|
|
17
17
|
export * from './metrics/ObserverResult';
|
|
18
18
|
export * from './trace/attributes';
|
|
19
19
|
export * from './trace/Event';
|
|
20
|
-
export * from './trace/instrumentation/Plugin';
|
|
21
20
|
export * from './trace/link_context';
|
|
22
21
|
export * from './trace/link';
|
|
23
22
|
export * from './trace/NoopLogger';
|
package/build/src/index.js
CHANGED
|
@@ -32,8 +32,8 @@ __exportStar(require("./common/Time"), exports);
|
|
|
32
32
|
__exportStar(require("./context/context"), exports);
|
|
33
33
|
__exportStar(require("./context/propagation/TextMapPropagator"), exports);
|
|
34
34
|
__exportStar(require("./context/propagation/NoopTextMapPropagator"), exports);
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./
|
|
35
|
+
__exportStar(require("./baggage/Baggage"), exports);
|
|
36
|
+
__exportStar(require("./baggage/EntryValue"), exports);
|
|
37
37
|
__exportStar(require("./metrics/BatchObserverResult"), exports);
|
|
38
38
|
__exportStar(require("./metrics/BoundInstrument"), exports);
|
|
39
39
|
__exportStar(require("./metrics/Meter"), exports);
|
|
@@ -45,7 +45,6 @@ __exportStar(require("./metrics/Observation"), exports);
|
|
|
45
45
|
__exportStar(require("./metrics/ObserverResult"), exports);
|
|
46
46
|
__exportStar(require("./trace/attributes"), exports);
|
|
47
47
|
__exportStar(require("./trace/Event"), exports);
|
|
48
|
-
__exportStar(require("./trace/instrumentation/Plugin"), exports);
|
|
49
48
|
__exportStar(require("./trace/link_context"), exports);
|
|
50
49
|
__exportStar(require("./trace/link"), exports);
|
|
51
50
|
__exportStar(require("./trace/NoopLogger"), exports);
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,kDAAgC;AAChC,gDAA8B;AAC9B,oDAAkC;AAClC,0EAAwD;AACxD,8EAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,kDAAgC;AAChC,gDAA8B;AAC9B,oDAAkC;AAClC,0EAAwD;AACxD,8EAA4D;AAC5D,oDAAkC;AAClC,uDAAqC;AACrC,gEAA8C;AAC9C,4DAA0C;AAC1C,kDAAgC;AAChC,0DAAwC;AACxC,mDAAiC;AACjC,sDAAoC;AACpC,8DAA4C;AAC5C,wDAAsC;AACtC,2DAAyC;AACzC,qDAAmC;AACnC,gDAA8B;AAC9B,uDAAqC;AACrC,+CAA6B;AAC7B,qDAAmC;AACnC,mDAAiC;AACjC,qDAAmC;AACnC,6DAA2C;AAC3C,sDAAoC;AACpC,8DAA4C;AAC5C,kDAAgC;AAChC,yDAAuC;AACvC,uDAAqC;AACrC,oDAAkC;AAClC,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC;AACxC,iDAA+B;AAE/B,+DAOmC;AANjC,mHAAA,cAAc,OAAA;AACd,oHAAA,eAAe,OAAA;AACf,yHAAA,oBAAoB,OAAA;AACpB,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,kHAAA,aAAa,OAAA;AAGf,4DAKqC;AAHnC,4GAAA,YAAY,OAAA;AACZ,gHAAA,gBAAgB,OAAA;AAIlB,yCAA2C;AAC3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,qCAAuC;AACvC,+BAA+B;AAClB,QAAA,KAAK,GAAG,gBAAQ,CAAC,WAAW,EAAE,CAAC;AAE5C,yCAA2C;AAC3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,iDAAmD;AACnD,qCAAqC;AACxB,QAAA,WAAW,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC;AAExD,kBAAe;IACb,KAAK,eAAA;IACL,OAAO,iBAAA;IACP,OAAO,iBAAA;IACP,WAAW,qBAAA;CACZ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BatchObserverResult } from './BatchObserverResult';
|
|
2
|
-
import { MetricOptions, Counter, ValueRecorder, ValueObserver,
|
|
2
|
+
import { MetricOptions, Counter, ValueRecorder, ValueObserver, BatchObserverOptions, UpDownCounter, SumObserver, UpDownSumObserver } from './Metric';
|
|
3
3
|
import { ObserverResult } from './ObserverResult';
|
|
4
4
|
/**
|
|
5
5
|
* An interface to allow the recording metrics.
|
|
@@ -63,12 +63,11 @@ export interface Meter {
|
|
|
63
63
|
*/
|
|
64
64
|
createUpDownSumObserver(name: string, options?: MetricOptions, callback?: (observerResult: ObserverResult) => void): UpDownSumObserver;
|
|
65
65
|
/**
|
|
66
|
-
* Creates a new `BatchObserver
|
|
66
|
+
* Creates a new `BatchObserver`, can be used to update many metrics
|
|
67
67
|
* at the same time and when operations needs to be async
|
|
68
|
-
* @param name the name of the metric.
|
|
69
68
|
* @param callback the batch observer callback
|
|
70
|
-
* @param [options] the
|
|
69
|
+
* @param [options] the batch observer options.
|
|
71
70
|
*/
|
|
72
|
-
createBatchObserver(
|
|
71
|
+
createBatchObserver(callback: (batchObserverResult: BatchObserverResult) => void, options?: BatchObserverOptions): void;
|
|
73
72
|
}
|
|
74
73
|
//# sourceMappingURL=Meter.d.ts.map
|
|
@@ -37,11 +37,15 @@ export interface MetricOptions {
|
|
|
37
37
|
*/
|
|
38
38
|
boundaries?: number[];
|
|
39
39
|
}
|
|
40
|
-
export interface
|
|
40
|
+
export interface BatchObserverOptions {
|
|
41
41
|
/**
|
|
42
42
|
* Indicates how long the batch metric should wait to update before cancel
|
|
43
43
|
*/
|
|
44
44
|
maxTimeoutUpdateMS?: number;
|
|
45
|
+
/**
|
|
46
|
+
* User provided logger.
|
|
47
|
+
*/
|
|
48
|
+
logger?: Logger;
|
|
45
49
|
}
|
|
46
50
|
/** The Type of value. It describes how the data is reported. */
|
|
47
51
|
export declare enum ValueType {
|
|
@@ -123,8 +127,6 @@ export declare type ValueObserver = BaseObserver;
|
|
|
123
127
|
export declare type UpDownSumObserver = BaseObserver;
|
|
124
128
|
/** Base interface for the SumObserver metrics. */
|
|
125
129
|
export declare type SumObserver = BaseObserver;
|
|
126
|
-
/** Base interface for the Batch Observer metrics. */
|
|
127
|
-
export declare type BatchObserver = Metric;
|
|
128
130
|
/**
|
|
129
131
|
* key-value pairs passed by the user.
|
|
130
132
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../src/metrics/Metric.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../src/metrics/Metric.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAkEH,gEAAgE;AAChE,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,uCAAG,CAAA;IACH,6CAAM,CAAA;AACR,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BatchObserverResult } from './BatchObserverResult';
|
|
2
2
|
import { Meter } from './Meter';
|
|
3
|
-
import { MetricOptions, UnboundMetric, Labels, Counter, ValueRecorder, ValueObserver,
|
|
3
|
+
import { MetricOptions, UnboundMetric, Labels, Counter, ValueRecorder, ValueObserver, UpDownCounter, BaseObserver, UpDownSumObserver } from './Metric';
|
|
4
4
|
import { BoundValueRecorder, BoundCounter, BoundBaseObserver } from './BoundInstrument';
|
|
5
|
-
import {
|
|
5
|
+
import { Baggage } from '../baggage/Baggage';
|
|
6
6
|
import { SpanContext } from '../trace/span_context';
|
|
7
7
|
import { ObserverResult } from './ObserverResult';
|
|
8
8
|
/**
|
|
@@ -55,7 +55,7 @@ export declare class NoopMeter implements Meter {
|
|
|
55
55
|
* @param name the name of the metric.
|
|
56
56
|
* @param callback the batch observer callback
|
|
57
57
|
*/
|
|
58
|
-
createBatchObserver(
|
|
58
|
+
createBatchObserver(_callback: (batchObserverResult: BatchObserverResult) => void): NoopBatchObserver;
|
|
59
59
|
}
|
|
60
60
|
export declare class NoopMetric<T> implements UnboundMetric<T> {
|
|
61
61
|
private readonly _instrument;
|
|
@@ -90,13 +90,13 @@ export declare class NoopBaseObserverMetric extends NoopMetric<BoundBaseObserver
|
|
|
90
90
|
value: number;
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
export declare class
|
|
93
|
+
export declare class NoopBatchObserver {
|
|
94
94
|
}
|
|
95
95
|
export declare class NoopBoundCounter implements BoundCounter {
|
|
96
96
|
add(_value: number): void;
|
|
97
97
|
}
|
|
98
98
|
export declare class NoopBoundValueRecorder implements BoundValueRecorder {
|
|
99
|
-
record(_value: number,
|
|
99
|
+
record(_value: number, _baggage?: Baggage, _spanContext?: SpanContext): void;
|
|
100
100
|
}
|
|
101
101
|
export declare class NoopBoundBaseObserver implements BoundBaseObserver {
|
|
102
102
|
update(_value: number): void;
|
|
@@ -110,5 +110,5 @@ export declare const NOOP_BOUND_BASE_OBSERVER: NoopBoundBaseObserver;
|
|
|
110
110
|
export declare const NOOP_VALUE_OBSERVER_METRIC: NoopBaseObserverMetric;
|
|
111
111
|
export declare const NOOP_UP_DOWN_SUM_OBSERVER_METRIC: NoopBaseObserverMetric;
|
|
112
112
|
export declare const NOOP_SUM_OBSERVER_METRIC: NoopBaseObserverMetric;
|
|
113
|
-
export declare const
|
|
113
|
+
export declare const NOOP_BATCH_OBSERVER: NoopBatchObserver;
|
|
114
114
|
//# sourceMappingURL=NoopMeter.d.ts.map
|
|
@@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
28
28
|
};
|
|
29
29
|
})();
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.
|
|
31
|
+
exports.NOOP_BATCH_OBSERVER = exports.NOOP_SUM_OBSERVER_METRIC = exports.NOOP_UP_DOWN_SUM_OBSERVER_METRIC = exports.NOOP_VALUE_OBSERVER_METRIC = exports.NOOP_BOUND_BASE_OBSERVER = exports.NOOP_VALUE_RECORDER_METRIC = exports.NOOP_BOUND_VALUE_RECORDER = exports.NOOP_COUNTER_METRIC = exports.NOOP_BOUND_COUNTER = exports.NOOP_METER = exports.NoopBoundBaseObserver = exports.NoopBoundValueRecorder = exports.NoopBoundCounter = exports.NoopBatchObserver = exports.NoopBaseObserverMetric = exports.NoopValueRecorderMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0;
|
|
32
32
|
/**
|
|
33
33
|
* NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
|
|
34
34
|
* constant NoopMetrics for all of its methods.
|
|
@@ -92,8 +92,8 @@ var NoopMeter = /** @class */ (function () {
|
|
|
92
92
|
* @param name the name of the metric.
|
|
93
93
|
* @param callback the batch observer callback
|
|
94
94
|
*/
|
|
95
|
-
NoopMeter.prototype.createBatchObserver = function (
|
|
96
|
-
return exports.
|
|
95
|
+
NoopMeter.prototype.createBatchObserver = function (_callback) {
|
|
96
|
+
return exports.NOOP_BATCH_OBSERVER;
|
|
97
97
|
};
|
|
98
98
|
return NoopMeter;
|
|
99
99
|
}());
|
|
@@ -164,14 +164,12 @@ var NoopBaseObserverMetric = /** @class */ (function (_super) {
|
|
|
164
164
|
return NoopBaseObserverMetric;
|
|
165
165
|
}(NoopMetric));
|
|
166
166
|
exports.NoopBaseObserverMetric = NoopBaseObserverMetric;
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
function NoopBatchObserverMetric() {
|
|
170
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
167
|
+
var NoopBatchObserver = /** @class */ (function () {
|
|
168
|
+
function NoopBatchObserver() {
|
|
171
169
|
}
|
|
172
|
-
return
|
|
173
|
-
}(
|
|
174
|
-
exports.
|
|
170
|
+
return NoopBatchObserver;
|
|
171
|
+
}());
|
|
172
|
+
exports.NoopBatchObserver = NoopBatchObserver;
|
|
175
173
|
var NoopBoundCounter = /** @class */ (function () {
|
|
176
174
|
function NoopBoundCounter() {
|
|
177
175
|
}
|
|
@@ -184,7 +182,7 @@ exports.NoopBoundCounter = NoopBoundCounter;
|
|
|
184
182
|
var NoopBoundValueRecorder = /** @class */ (function () {
|
|
185
183
|
function NoopBoundValueRecorder() {
|
|
186
184
|
}
|
|
187
|
-
NoopBoundValueRecorder.prototype.record = function (_value,
|
|
185
|
+
NoopBoundValueRecorder.prototype.record = function (_value, _baggage, _spanContext) {
|
|
188
186
|
return;
|
|
189
187
|
};
|
|
190
188
|
return NoopBoundValueRecorder;
|
|
@@ -206,5 +204,5 @@ exports.NOOP_BOUND_BASE_OBSERVER = new NoopBoundBaseObserver();
|
|
|
206
204
|
exports.NOOP_VALUE_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER);
|
|
207
205
|
exports.NOOP_UP_DOWN_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER);
|
|
208
206
|
exports.NOOP_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER);
|
|
209
|
-
exports.
|
|
207
|
+
exports.NOOP_BATCH_OBSERVER = new NoopBatchObserver();
|
|
210
208
|
//# sourceMappingURL=NoopMeter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopMeter.js","sourceRoot":"","sources":["../../../src/metrics/NoopMeter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"NoopMeter.js","sourceRoot":"","sources":["../../../src/metrics/NoopMeter.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TraceState } from './trace_state';
|
|
2
2
|
/**
|
|
3
3
|
* A SpanContext represents the portion of a {@link Span} which must be
|
|
4
|
-
* serialized and propagated along side of a {@link
|
|
4
|
+
* serialized and propagated along side of a {@link Baggage}.
|
|
5
5
|
*/
|
|
6
6
|
export interface SpanContext {
|
|
7
7
|
/**
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.14.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Public API for OpenTelemetry",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"types": "build/src/index.d.ts",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@opentelemetry/context-base": "^0.
|
|
55
|
+
"@opentelemetry/context-base": "^0.14.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@types/mocha": "8.0
|
|
59
|
-
"@types/node": "14.14.
|
|
58
|
+
"@types/mocha": "8.2.0",
|
|
59
|
+
"@types/node": "14.14.12",
|
|
60
60
|
"@types/sinon": "9.0.9",
|
|
61
61
|
"@types/webpack-env": "1.16.0",
|
|
62
62
|
"codecov": "3.8.1",
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"karma-mocha": "2.0.1",
|
|
69
69
|
"karma-spec-reporter": "0.0.32",
|
|
70
70
|
"karma-webpack": "4.0.2",
|
|
71
|
-
"linkinator": "2.
|
|
71
|
+
"linkinator": "2.8.0",
|
|
72
72
|
"mocha": "7.2.0",
|
|
73
73
|
"nyc": "15.1.0",
|
|
74
|
-
"sinon": "9.2.
|
|
75
|
-
"ts-loader": "8.0.
|
|
74
|
+
"sinon": "9.2.2",
|
|
75
|
+
"ts-loader": "8.0.12",
|
|
76
76
|
"ts-mocha": "8.0.0",
|
|
77
77
|
"typedoc": "0.19.2",
|
|
78
78
|
"typescript": "3.9.7",
|
|
79
79
|
"webpack": "4.44.2"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "27a8d4530c56257c191468b073669909bf8892a1"
|
|
82
82
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright The OpenTelemetry Authors
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
//# sourceMappingURL=CorrelationContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CorrelationContext.js","sourceRoot":"","sources":["../../../src/correlation_context/CorrelationContext.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntryValue.js","sourceRoot":"","sources":["../../../src/correlation_context/EntryValue.ts"],"names":[],"mappings":";;;AAyBA;;;;GAIG;AACH,IAAY,QASX;AATD,WAAY,QAAQ;IAClB;;;OAGG;IACH,2DAAkB,CAAA;IAElB,0DAA0D;IAC1D,0EAA0B,CAAA;AAC5B,CAAC,EATW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QASnB"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../../common/Logger';
|
|
2
|
-
import { TracerProvider } from '../tracer_provider';
|
|
3
|
-
/** Interface Plugin to apply patch. */
|
|
4
|
-
export interface Plugin<T = any> {
|
|
5
|
-
/**
|
|
6
|
-
* Contains all supported versions.
|
|
7
|
-
* All versions must be compatible with [semver](https://semver.org/spec/v2.0.0.html) format.
|
|
8
|
-
* If the version is not supported, we won't apply instrumentation patch (see `enable` method).
|
|
9
|
-
* If omitted, all versions of the module will be patched.
|
|
10
|
-
*/
|
|
11
|
-
supportedVersions?: string[];
|
|
12
|
-
/**
|
|
13
|
-
* Name of the module that the plugin instrument.
|
|
14
|
-
*/
|
|
15
|
-
moduleName: string;
|
|
16
|
-
/**
|
|
17
|
-
* Method that enables the instrumentation patch.
|
|
18
|
-
* @param moduleExports The value of the `module.exports` property that would
|
|
19
|
-
* normally be exposed by the required module. ex: `http`, `https` etc.
|
|
20
|
-
* @param TracerProvider a tracer provider.
|
|
21
|
-
* @param logger a logger instance.
|
|
22
|
-
* @param [config] an object to configure the plugin.
|
|
23
|
-
*/
|
|
24
|
-
enable(moduleExports: T, TracerProvider: TracerProvider, logger: Logger, config?: PluginConfig): T;
|
|
25
|
-
/** Method to disable the instrumentation */
|
|
26
|
-
disable(): void;
|
|
27
|
-
}
|
|
28
|
-
export interface PluginConfig {
|
|
29
|
-
/**
|
|
30
|
-
* Whether to enable the plugin.
|
|
31
|
-
* @default true
|
|
32
|
-
*/
|
|
33
|
-
enabled?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Path of the trace plugin to load.
|
|
36
|
-
* @default '@opentelemetry/plugin-http' in case of http.
|
|
37
|
-
*/
|
|
38
|
-
path?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Request methods that match any string in ignoreMethods will not be traced.
|
|
41
|
-
*/
|
|
42
|
-
ignoreMethods?: string[];
|
|
43
|
-
/**
|
|
44
|
-
* URLs that partially match any regex in ignoreUrls will not be traced.
|
|
45
|
-
* In addition, URLs that are _exact matches_ of strings in ignoreUrls will
|
|
46
|
-
* also not be traced.
|
|
47
|
-
*/
|
|
48
|
-
ignoreUrls?: Array<string | RegExp>;
|
|
49
|
-
/**
|
|
50
|
-
* List of internal files that need patch and are not exported by
|
|
51
|
-
* default.
|
|
52
|
-
*/
|
|
53
|
-
internalFilesExports?: PluginInternalFiles;
|
|
54
|
-
/**
|
|
55
|
-
* If true, additional information about query parameters and
|
|
56
|
-
* results will be attached (as `attributes`) to spans representing
|
|
57
|
-
* database operations.
|
|
58
|
-
*/
|
|
59
|
-
enhancedDatabaseReporting?: boolean;
|
|
60
|
-
}
|
|
61
|
-
export interface PluginInternalFilesVersion {
|
|
62
|
-
[pluginName: string]: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Each key should be the name of the module to trace, and its value
|
|
66
|
-
* a mapping of a property name to a internal plugin file name.
|
|
67
|
-
*/
|
|
68
|
-
export interface PluginInternalFiles {
|
|
69
|
-
[versions: string]: PluginInternalFilesVersion;
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../../../src/trace/instrumentation/Plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|