@opentelemetry/api 0.12.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/README.md +2 -2
- package/build/src/api/global-utils.d.ts +1 -1
- package/build/src/api/global-utils.js +1 -1
- package/build/src/api/propagation.d.ts +5 -7
- package/build/src/api/propagation.js +7 -12
- 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/context/propagation/NoopTextMapPropagator.d.ts +3 -2
- package/build/src/context/propagation/NoopTextMapPropagator.js +5 -2
- package/build/src/context/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/context/propagation/TextMapPropagator.d.ts +52 -9
- package/build/src/context/propagation/TextMapPropagator.js +23 -0
- package/build/src/context/propagation/TextMapPropagator.js.map +1 -1
- package/build/src/index.d.ts +2 -5
- package/build/src/index.js +2 -5
- package/build/src/index.js.map +1 -1
- package/build/src/metrics/Meter.d.ts +18 -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 +28 -14
- package/build/src/metrics/NoopMeter.js +36 -20
- package/build/src/metrics/NoopMeter.js.map +1 -1
- package/build/src/trace/NoopLogger.d.ts +4 -4
- package/build/src/trace/NoopLogger.js +12 -12
- package/build/src/trace/NoopLogger.js.map +1 -1
- package/build/src/trace/NoopSpan.d.ts +7 -7
- package/build/src/trace/NoopSpan.js +7 -7
- package/build/src/trace/NoopSpan.js.map +1 -1
- package/build/src/trace/NoopTracer.d.ts +1 -1
- package/build/src/trace/NoopTracer.js +6 -7
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/Sampler.d.ts +4 -5
- package/build/src/trace/SpanOptions.d.ts +2 -15
- package/build/src/trace/attributes.d.ts +5 -0
- package/build/src/trace/span.d.ts +5 -2
- package/build/src/trace/span_context.d.ts +1 -1
- package/build/src/trace/status.d.ts +10 -128
- package/build/src/trace/status.js +12 -130
- package/build/src/trace/status.js.map +1 -1
- package/build/src/trace/trace_state.d.ts +8 -7
- package/build/src/trace/trace_state.js +15 -0
- package/build/src/trace/trace_state.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/package.json +15 -15
- package/build/src/context/propagation/HttpTextPropagator.d.ts +0 -44
- package/build/src/context/propagation/HttpTextPropagator.js +0 -18
- package/build/src/context/propagation/HttpTextPropagator.js.map +0 -1
- package/build/src/context/propagation/NoopHttpTextPropagator.d.ts +0 -13
- package/build/src/context/propagation/NoopHttpTextPropagator.js +0 -35
- package/build/src/context/propagation/NoopHttpTextPropagator.js.map +0 -1
- package/build/src/context/propagation/getter.d.ts +0 -10
- package/build/src/context/propagation/getter.js +0 -30
- package/build/src/context/propagation/getter.js.map +0 -1
- package/build/src/context/propagation/setter.d.ts +0 -9
- package/build/src/context/propagation/setter.js +0 -29
- package/build/src/context/propagation/setter.js.map +0 -1
- 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/metrics/MetricObservable.d.ts +0 -18
- package/build/src/metrics/MetricObservable.js +0 -3
- package/build/src/metrics/MetricObservable.js.map +0 -1
- package/build/src/trace/instrumentation/BasePlugin.d.ts +0 -65
- package/build/src/trace/instrumentation/BasePlugin.js +0 -18
- package/build/src/trace/instrumentation/BasePlugin.js.map +0 -1
- package/build/src/trace/instrumentation/Instrumentation.d.ts +0 -50
- package/build/src/trace/instrumentation/Instrumentation.js +0 -18
- package/build/src/trace/instrumentation/Instrumentation.js.map +0 -1
- package/build/src/trace/instrumentation/Plugin.d.ts +0 -71
- package/build/src/trace/instrumentation/Plugin.js.map +0 -1
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ Because the npm installer and node module resolution algorithm could potentially
|
|
|
106
106
|
If you prefer to choose your own propagator or context manager, you may pass an options object into the `tracerProvider.register()` method. Omitted or `undefined` options will be replaced by a default value and `null` values will be skipped.
|
|
107
107
|
|
|
108
108
|
```javascript
|
|
109
|
-
const { B3Propagator } = require("@opentelemetry/
|
|
109
|
+
const { B3Propagator } = require("@opentelemetry/propagator-b3");
|
|
110
110
|
|
|
111
111
|
tracerProvider.register({
|
|
112
112
|
// Use B3 Propagation
|
|
@@ -168,7 +168,7 @@ async function doSomething() {
|
|
|
168
168
|
} catch (err) {
|
|
169
169
|
span.setStatus({
|
|
170
170
|
// use an appropriate status code here
|
|
171
|
-
code: api.
|
|
171
|
+
code: api.StatusCode.ERROR,
|
|
172
172
|
message: err.message,
|
|
173
173
|
});
|
|
174
174
|
span.end();
|
|
@@ -29,6 +29,6 @@ export declare function makeGetter<T>(requiredVersion: number, instance: T, fall
|
|
|
29
29
|
* version. If the global API is not compatible with the API package
|
|
30
30
|
* attempting to get it, a NOOP API implementation will be returned.
|
|
31
31
|
*/
|
|
32
|
-
export declare const API_BACKWARDS_COMPATIBILITY_VERSION =
|
|
32
|
+
export declare const API_BACKWARDS_COMPATIBILITY_VERSION = 2;
|
|
33
33
|
export {};
|
|
34
34
|
//# sourceMappingURL=global-utils.d.ts.map
|
|
@@ -43,5 +43,5 @@ exports.makeGetter = makeGetter;
|
|
|
43
43
|
* version. If the global API is not compatible with the API package
|
|
44
44
|
* attempting to get it, a NOOP API implementation will be returned.
|
|
45
45
|
*/
|
|
46
|
-
exports.API_BACKWARDS_COMPATIBILITY_VERSION =
|
|
46
|
+
exports.API_BACKWARDS_COMPATIBILITY_VERSION = 2;
|
|
47
47
|
//# sourceMappingURL=global-utils.js.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Context } from '@opentelemetry/context-base';
|
|
2
|
-
import {
|
|
3
|
-
import { TextMapPropagator } from '../context/propagation/TextMapPropagator';
|
|
4
|
-
import { SetterFunction } from '../context/propagation/setter';
|
|
2
|
+
import { TextMapGetter, TextMapPropagator, TextMapSetter } from '../context/propagation/TextMapPropagator';
|
|
5
3
|
/**
|
|
6
4
|
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
7
5
|
*/
|
|
@@ -18,19 +16,19 @@ export declare class PropagationAPI {
|
|
|
18
16
|
/**
|
|
19
17
|
* Inject context into a carrier to be propagated inter-process
|
|
20
18
|
*
|
|
19
|
+
* @param context Context carrying tracing data to inject
|
|
21
20
|
* @param carrier carrier to inject context into
|
|
22
21
|
* @param setter Function used to set values on the carrier
|
|
23
|
-
* @param context Context carrying tracing data to inject. Defaults to the currently active context.
|
|
24
22
|
*/
|
|
25
|
-
inject<Carrier>(carrier: Carrier, setter?:
|
|
23
|
+
inject<Carrier>(context: Context, carrier: Carrier, setter?: TextMapSetter<Carrier>): void;
|
|
26
24
|
/**
|
|
27
25
|
* Extract context from a carrier
|
|
28
26
|
*
|
|
27
|
+
* @param context Context which the newly created context will inherit from
|
|
29
28
|
* @param carrier Carrier to extract context from
|
|
30
29
|
* @param getter Function used to extract keys from a carrier
|
|
31
|
-
* @param context Context which the newly created context will inherit from. Defaults to the currently active context.
|
|
32
30
|
*/
|
|
33
|
-
extract<Carrier>(carrier: Carrier, getter?:
|
|
31
|
+
extract<Carrier>(context: Context, carrier: Carrier, getter?: TextMapGetter<Carrier>): Context;
|
|
34
32
|
/** Remove the global propagator */
|
|
35
33
|
disable(): void;
|
|
36
34
|
private _getGlobalPropagator;
|
|
@@ -16,12 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.PropagationAPI = void 0;
|
|
19
|
-
var getter_1 = require("../context/propagation/getter");
|
|
20
19
|
var NoopTextMapPropagator_1 = require("../context/propagation/NoopTextMapPropagator");
|
|
21
|
-
var
|
|
22
|
-
var context_1 = require("./context");
|
|
20
|
+
var TextMapPropagator_1 = require("../context/propagation/TextMapPropagator");
|
|
23
21
|
var global_utils_1 = require("./global-utils");
|
|
24
|
-
var contextApi = context_1.ContextAPI.getInstance();
|
|
25
22
|
/**
|
|
26
23
|
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
27
24
|
*/
|
|
@@ -50,25 +47,23 @@ var PropagationAPI = /** @class */ (function () {
|
|
|
50
47
|
/**
|
|
51
48
|
* Inject context into a carrier to be propagated inter-process
|
|
52
49
|
*
|
|
50
|
+
* @param context Context carrying tracing data to inject
|
|
53
51
|
* @param carrier carrier to inject context into
|
|
54
52
|
* @param setter Function used to set values on the carrier
|
|
55
|
-
* @param context Context carrying tracing data to inject. Defaults to the currently active context.
|
|
56
53
|
*/
|
|
57
|
-
PropagationAPI.prototype.inject = function (carrier, setter
|
|
58
|
-
if (setter === void 0) { setter =
|
|
59
|
-
if (context === void 0) { context = contextApi.active(); }
|
|
54
|
+
PropagationAPI.prototype.inject = function (context, carrier, setter) {
|
|
55
|
+
if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; }
|
|
60
56
|
return this._getGlobalPropagator().inject(context, carrier, setter);
|
|
61
57
|
};
|
|
62
58
|
/**
|
|
63
59
|
* Extract context from a carrier
|
|
64
60
|
*
|
|
61
|
+
* @param context Context which the newly created context will inherit from
|
|
65
62
|
* @param carrier Carrier to extract context from
|
|
66
63
|
* @param getter Function used to extract keys from a carrier
|
|
67
|
-
* @param context Context which the newly created context will inherit from. Defaults to the currently active context.
|
|
68
64
|
*/
|
|
69
|
-
PropagationAPI.prototype.extract = function (carrier, getter
|
|
70
|
-
if (getter === void 0) { getter =
|
|
71
|
-
if (context === void 0) { context = contextApi.active(); }
|
|
65
|
+
PropagationAPI.prototype.extract = function (context, carrier, getter) {
|
|
66
|
+
if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; }
|
|
72
67
|
return this._getGlobalPropagator().extract(context, carrier, getter);
|
|
73
68
|
};
|
|
74
69
|
/** Remove the global propagator */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,
|
|
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"}
|
|
@@ -5,9 +5,10 @@ import { TextMapPropagator } from './TextMapPropagator';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class NoopTextMapPropagator implements TextMapPropagator {
|
|
7
7
|
/** Noop inject function does nothing */
|
|
8
|
-
inject(
|
|
8
|
+
inject(_context: Context, _carrier: unknown): void;
|
|
9
9
|
/** Noop extract function does nothing and returns the input context */
|
|
10
|
-
extract(context: Context,
|
|
10
|
+
extract(context: Context, _carrier: unknown): Context;
|
|
11
|
+
fields(): string[];
|
|
11
12
|
}
|
|
12
13
|
export declare const NOOP_TEXT_MAP_PROPAGATOR: NoopTextMapPropagator;
|
|
13
14
|
//# sourceMappingURL=NoopTextMapPropagator.d.ts.map
|
|
@@ -23,11 +23,14 @@ var NoopTextMapPropagator = /** @class */ (function () {
|
|
|
23
23
|
function NoopTextMapPropagator() {
|
|
24
24
|
}
|
|
25
25
|
/** Noop inject function does nothing */
|
|
26
|
-
NoopTextMapPropagator.prototype.inject = function (
|
|
26
|
+
NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };
|
|
27
27
|
/** Noop extract function does nothing and returns the input context */
|
|
28
|
-
NoopTextMapPropagator.prototype.extract = function (context,
|
|
28
|
+
NoopTextMapPropagator.prototype.extract = function (context, _carrier) {
|
|
29
29
|
return context;
|
|
30
30
|
};
|
|
31
|
+
NoopTextMapPropagator.prototype.fields = function () {
|
|
32
|
+
return [];
|
|
33
|
+
};
|
|
31
34
|
return NoopTextMapPropagator;
|
|
32
35
|
}());
|
|
33
36
|
exports.NoopTextMapPropagator = NoopTextMapPropagator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../../src/context/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH;IAAA;
|
|
1
|
+
{"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../../src/context/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH;IAAA;IAUA,CAAC;IATC,wCAAwC;IACxC,sCAAM,GAAN,UAAO,QAAiB,EAAE,QAAiB,IAAS,CAAC;IACrD,uEAAuE;IACvE,uCAAO,GAAP,UAAQ,OAAgB,EAAE,QAAiB;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,sCAAM,GAAN;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,4BAAC;AAAD,CAAC,AAVD,IAUC;AAVY,sDAAqB;AAYrB,QAAA,wBAAwB,GAAG,IAAI,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Context } from '@opentelemetry/context-base';
|
|
2
|
-
import { SetterFunction } from './setter';
|
|
3
|
-
import { GetterFunction } from './getter';
|
|
4
2
|
/**
|
|
5
3
|
* Injects `Context` into and extracts it from carriers that travel
|
|
6
4
|
* in-band across process boundaries. Encoding is expected to conform to the
|
|
@@ -12,7 +10,7 @@ import { GetterFunction } from './getter';
|
|
|
12
10
|
* usually implemented via library-specific request interceptors, where the
|
|
13
11
|
* client-side injects values and the server-side extracts them.
|
|
14
12
|
*/
|
|
15
|
-
export interface TextMapPropagator {
|
|
13
|
+
export interface TextMapPropagator<Carrier = any> {
|
|
16
14
|
/**
|
|
17
15
|
* Injects values from a given `Context` into a carrier.
|
|
18
16
|
*
|
|
@@ -23,10 +21,10 @@ export interface TextMapPropagator {
|
|
|
23
21
|
* the wire.
|
|
24
22
|
* @param carrier the carrier of propagation fields, such as http request
|
|
25
23
|
* headers.
|
|
26
|
-
* @param setter
|
|
27
|
-
*
|
|
24
|
+
* @param setter an optional {@link TextMapSetter}. If undefined, values will be
|
|
25
|
+
* set by direct object assignment.
|
|
28
26
|
*/
|
|
29
|
-
inject(context: Context, carrier:
|
|
27
|
+
inject(context: Context, carrier: Carrier, setter: TextMapSetter<Carrier>): void;
|
|
30
28
|
/**
|
|
31
29
|
* Given a `Context` and a carrier, extract context values from a
|
|
32
30
|
* carrier and return a new context, created from the old context, with the
|
|
@@ -36,9 +34,54 @@ export interface TextMapPropagator {
|
|
|
36
34
|
* the wire.
|
|
37
35
|
* @param carrier the carrier of propagation fields, such as http request
|
|
38
36
|
* headers.
|
|
39
|
-
* @param getter
|
|
40
|
-
*
|
|
37
|
+
* @param getter an optional {@link TextMapGetter}. If undefined, keys will be all
|
|
38
|
+
* own properties, and keys will be accessed by direct object access.
|
|
41
39
|
*/
|
|
42
|
-
extract(context: Context, carrier:
|
|
40
|
+
extract(context: Context, carrier: Carrier, getter: TextMapGetter<Carrier>): Context;
|
|
41
|
+
/**
|
|
42
|
+
* Return a list of all fields which may be used by the propagator.
|
|
43
|
+
*
|
|
44
|
+
* This list should be used to clear fields before calling inject if a carrier is
|
|
45
|
+
* used more than once.
|
|
46
|
+
*/
|
|
47
|
+
fields(): string[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A setter is specified by the caller to define a specific method
|
|
51
|
+
* to set key/value pairs on the carrier within a propagator.
|
|
52
|
+
*/
|
|
53
|
+
export interface TextMapSetter<Carrier = any> {
|
|
54
|
+
/**
|
|
55
|
+
* Callback used to set a key/value pair on an object.
|
|
56
|
+
*
|
|
57
|
+
* Should be called by the propagator each time a key/value pair
|
|
58
|
+
* should be set, and should set that key/value pair on the propagator.
|
|
59
|
+
*
|
|
60
|
+
* @param carrier object or class which carries key/value pairs
|
|
61
|
+
* @param key string key to modify
|
|
62
|
+
* @param value value to be set to the key on the carrier
|
|
63
|
+
*/
|
|
64
|
+
set(carrier: Carrier, key: string, value: string): void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A getter is specified by the caller to define a specific method
|
|
68
|
+
* to get the value of a key from a carrier.
|
|
69
|
+
*/
|
|
70
|
+
export interface TextMapGetter<Carrier = any> {
|
|
71
|
+
/**
|
|
72
|
+
* Get a list of all keys available on the carrier.
|
|
73
|
+
*
|
|
74
|
+
* @param carrier
|
|
75
|
+
*/
|
|
76
|
+
keys(carrier: Carrier): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Get the value of a specific key from the carrier.
|
|
79
|
+
*
|
|
80
|
+
* @param carrier
|
|
81
|
+
* @param key
|
|
82
|
+
*/
|
|
83
|
+
get(carrier: Carrier, key: string): undefined | string | string[];
|
|
43
84
|
}
|
|
85
|
+
export declare const defaultTextMapGetter: TextMapGetter;
|
|
86
|
+
export declare const defaultTextMapSetter: TextMapSetter;
|
|
44
87
|
//# sourceMappingURL=TextMapPropagator.d.ts.map
|
|
@@ -15,4 +15,27 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0;
|
|
19
|
+
exports.defaultTextMapGetter = {
|
|
20
|
+
get: function (carrier, key) {
|
|
21
|
+
if (carrier == null) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return carrier[key];
|
|
25
|
+
},
|
|
26
|
+
keys: function (carrier) {
|
|
27
|
+
if (carrier == null) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return Object.keys(carrier);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
exports.defaultTextMapSetter = {
|
|
34
|
+
set: function (carrier, key, value) {
|
|
35
|
+
if (carrier == null) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
carrier[key] = value;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
18
41
|
//# sourceMappingURL=TextMapPropagator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextMapPropagator.js","sourceRoot":"","sources":["../../../../src/context/propagation/TextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
1
|
+
{"version":3,"file":"TextMapPropagator.js","sourceRoot":"","sources":["../../../../src/context/propagation/TextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAqGU,QAAA,oBAAoB,GAAkB;IACjD,GAAG,YAAC,OAAO,EAAE,GAAG;QACd,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,YAAC,OAAO;QACV,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC;AAEW,QAAA,oBAAoB,GAAkB;IACjD,GAAG,YAAC,OAAO,EAAE,GAAG,EAAE,KAAK;QACrB,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACvB,CAAC;CACF,CAAC"}
|
package/build/src/index.d.ts
CHANGED
|
@@ -2,12 +2,10 @@ export * from './common/Exception';
|
|
|
2
2
|
export * from './common/Logger';
|
|
3
3
|
export * from './common/Time';
|
|
4
4
|
export * from './context/context';
|
|
5
|
-
export * from './context/propagation/getter';
|
|
6
5
|
export * from './context/propagation/TextMapPropagator';
|
|
7
6
|
export * from './context/propagation/NoopTextMapPropagator';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './correlation_context/EntryValue';
|
|
7
|
+
export * from './baggage/Baggage';
|
|
8
|
+
export * from './baggage/EntryValue';
|
|
11
9
|
export * from './metrics/BatchObserverResult';
|
|
12
10
|
export * from './metrics/BoundInstrument';
|
|
13
11
|
export * from './metrics/Meter';
|
|
@@ -19,7 +17,6 @@ export * from './metrics/Observation';
|
|
|
19
17
|
export * from './metrics/ObserverResult';
|
|
20
18
|
export * from './trace/attributes';
|
|
21
19
|
export * from './trace/Event';
|
|
22
|
-
export * from './trace/instrumentation/Plugin';
|
|
23
20
|
export * from './trace/link_context';
|
|
24
21
|
export * from './trace/link';
|
|
25
22
|
export * from './trace/NoopLogger';
|
package/build/src/index.js
CHANGED
|
@@ -30,12 +30,10 @@ __exportStar(require("./common/Exception"), exports);
|
|
|
30
30
|
__exportStar(require("./common/Logger"), exports);
|
|
31
31
|
__exportStar(require("./common/Time"), exports);
|
|
32
32
|
__exportStar(require("./context/context"), exports);
|
|
33
|
-
__exportStar(require("./context/propagation/getter"), exports);
|
|
34
33
|
__exportStar(require("./context/propagation/TextMapPropagator"), exports);
|
|
35
34
|
__exportStar(require("./context/propagation/NoopTextMapPropagator"), exports);
|
|
36
|
-
__exportStar(require("./
|
|
37
|
-
__exportStar(require("./
|
|
38
|
-
__exportStar(require("./correlation_context/EntryValue"), exports);
|
|
35
|
+
__exportStar(require("./baggage/Baggage"), exports);
|
|
36
|
+
__exportStar(require("./baggage/EntryValue"), exports);
|
|
39
37
|
__exportStar(require("./metrics/BatchObserverResult"), exports);
|
|
40
38
|
__exportStar(require("./metrics/BoundInstrument"), exports);
|
|
41
39
|
__exportStar(require("./metrics/Meter"), exports);
|
|
@@ -47,7 +45,6 @@ __exportStar(require("./metrics/Observation"), exports);
|
|
|
47
45
|
__exportStar(require("./metrics/ObserverResult"), exports);
|
|
48
46
|
__exportStar(require("./trace/attributes"), exports);
|
|
49
47
|
__exportStar(require("./trace/Event"), exports);
|
|
50
|
-
__exportStar(require("./trace/instrumentation/Plugin"), exports);
|
|
51
48
|
__exportStar(require("./trace/link_context"), exports);
|
|
52
49
|
__exportStar(require("./trace/link"), exports);
|
|
53
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
|
|
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.
|
|
@@ -49,12 +49,25 @@ export interface Meter {
|
|
|
49
49
|
*/
|
|
50
50
|
createValueObserver(name: string, options?: MetricOptions, callback?: (observerResult: ObserverResult) => void): ValueObserver;
|
|
51
51
|
/**
|
|
52
|
-
* Creates a new `
|
|
53
|
-
*
|
|
52
|
+
* Creates a new `SumObserver` metric.
|
|
53
|
+
* @param name the name of the metric.
|
|
54
|
+
* @param [options] the metric options.
|
|
55
|
+
* @param [callback] the observer callback
|
|
56
|
+
*/
|
|
57
|
+
createSumObserver(name: string, options?: MetricOptions, callback?: (observerResult: ObserverResult) => void): SumObserver;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new `UpDownSumObserver` metric.
|
|
54
60
|
* @param name the name of the metric.
|
|
61
|
+
* @param [options] the metric options.
|
|
62
|
+
* @param [callback] the observer callback
|
|
63
|
+
*/
|
|
64
|
+
createUpDownSumObserver(name: string, options?: MetricOptions, callback?: (observerResult: ObserverResult) => void): UpDownSumObserver;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new `BatchObserver`, can be used to update many metrics
|
|
67
|
+
* at the same time and when operations needs to be async
|
|
55
68
|
* @param callback the batch observer callback
|
|
56
|
-
* @param [options] the
|
|
69
|
+
* @param [options] the batch observer options.
|
|
57
70
|
*/
|
|
58
|
-
createBatchObserver(
|
|
71
|
+
createBatchObserver(callback: (batchObserverResult: BatchObserverResult) => void, options?: BatchObserverOptions): void;
|
|
59
72
|
}
|
|
60
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
|
/**
|
|
@@ -16,32 +16,46 @@ export declare class NoopMeter implements Meter {
|
|
|
16
16
|
* @param name the name of the metric.
|
|
17
17
|
* @param [options] the metric options.
|
|
18
18
|
*/
|
|
19
|
-
createValueRecorder(
|
|
19
|
+
createValueRecorder(_name: string, _options?: MetricOptions): ValueRecorder;
|
|
20
20
|
/**
|
|
21
21
|
* Returns a constant noop counter.
|
|
22
22
|
* @param name the name of the metric.
|
|
23
23
|
* @param [options] the metric options.
|
|
24
24
|
*/
|
|
25
|
-
createCounter(
|
|
25
|
+
createCounter(_name: string, _options?: MetricOptions): Counter;
|
|
26
26
|
/**
|
|
27
27
|
* Returns a constant noop UpDownCounter.
|
|
28
28
|
* @param name the name of the metric.
|
|
29
29
|
* @param [options] the metric options.
|
|
30
30
|
*/
|
|
31
|
-
createUpDownCounter(
|
|
31
|
+
createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter;
|
|
32
32
|
/**
|
|
33
33
|
* Returns constant noop value observer.
|
|
34
34
|
* @param name the name of the metric.
|
|
35
35
|
* @param [options] the metric options.
|
|
36
36
|
* @param [callback] the value observer callback
|
|
37
37
|
*/
|
|
38
|
-
createValueObserver(
|
|
38
|
+
createValueObserver(_name: string, _options?: MetricOptions, _callback?: (observerResult: ObserverResult) => void): ValueObserver;
|
|
39
|
+
/**
|
|
40
|
+
* Returns constant noop sum observer.
|
|
41
|
+
* @param name the name of the metric.
|
|
42
|
+
* @param [options] the metric options.
|
|
43
|
+
* @param [callback] the sum observer callback
|
|
44
|
+
*/
|
|
45
|
+
createSumObserver(_name: string, _options?: MetricOptions, _callback?: (observerResult: ObserverResult) => void): ValueObserver;
|
|
46
|
+
/**
|
|
47
|
+
* Returns constant noop up down sum observer.
|
|
48
|
+
* @param name the name of the metric.
|
|
49
|
+
* @param [options] the metric options.
|
|
50
|
+
* @param [callback] the up down sum observer callback
|
|
51
|
+
*/
|
|
52
|
+
createUpDownSumObserver(_name: string, _options?: MetricOptions, _callback?: (observerResult: ObserverResult) => void): UpDownSumObserver;
|
|
39
53
|
/**
|
|
40
54
|
* Returns constant noop batch observer.
|
|
41
55
|
* @param name the name of the metric.
|
|
42
56
|
* @param callback the batch observer callback
|
|
43
57
|
*/
|
|
44
|
-
createBatchObserver(
|
|
58
|
+
createBatchObserver(_callback: (batchObserverResult: BatchObserverResult) => void): NoopBatchObserver;
|
|
45
59
|
}
|
|
46
60
|
export declare class NoopMetric<T> implements UnboundMetric<T> {
|
|
47
61
|
private readonly _instrument;
|
|
@@ -53,12 +67,12 @@ export declare class NoopMetric<T> implements UnboundMetric<T> {
|
|
|
53
67
|
* @param labels key-values pairs that are associated with a specific metric
|
|
54
68
|
* that you want to record.
|
|
55
69
|
*/
|
|
56
|
-
bind(
|
|
70
|
+
bind(_labels: Labels): T;
|
|
57
71
|
/**
|
|
58
72
|
* Removes the Binding from the metric, if it is present.
|
|
59
73
|
* @param labels key-values pairs that are associated with a specific metric.
|
|
60
74
|
*/
|
|
61
|
-
unbind(
|
|
75
|
+
unbind(_labels: Labels): void;
|
|
62
76
|
/**
|
|
63
77
|
* Clears all timeseries from the Metric.
|
|
64
78
|
*/
|
|
@@ -76,16 +90,16 @@ export declare class NoopBaseObserverMetric extends NoopMetric<BoundBaseObserver
|
|
|
76
90
|
value: number;
|
|
77
91
|
};
|
|
78
92
|
}
|
|
79
|
-
export declare class
|
|
93
|
+
export declare class NoopBatchObserver {
|
|
80
94
|
}
|
|
81
95
|
export declare class NoopBoundCounter implements BoundCounter {
|
|
82
|
-
add(
|
|
96
|
+
add(_value: number): void;
|
|
83
97
|
}
|
|
84
98
|
export declare class NoopBoundValueRecorder implements BoundValueRecorder {
|
|
85
|
-
record(
|
|
99
|
+
record(_value: number, _baggage?: Baggage, _spanContext?: SpanContext): void;
|
|
86
100
|
}
|
|
87
101
|
export declare class NoopBoundBaseObserver implements BoundBaseObserver {
|
|
88
|
-
update(
|
|
102
|
+
update(_value: number): void;
|
|
89
103
|
}
|
|
90
104
|
export declare const NOOP_METER: NoopMeter;
|
|
91
105
|
export declare const NOOP_BOUND_COUNTER: NoopBoundCounter;
|
|
@@ -96,5 +110,5 @@ export declare const NOOP_BOUND_BASE_OBSERVER: NoopBoundBaseObserver;
|
|
|
96
110
|
export declare const NOOP_VALUE_OBSERVER_METRIC: NoopBaseObserverMetric;
|
|
97
111
|
export declare const NOOP_UP_DOWN_SUM_OBSERVER_METRIC: NoopBaseObserverMetric;
|
|
98
112
|
export declare const NOOP_SUM_OBSERVER_METRIC: NoopBaseObserverMetric;
|
|
99
|
-
export declare const
|
|
113
|
+
export declare const NOOP_BATCH_OBSERVER: NoopBatchObserver;
|
|
100
114
|
//# sourceMappingURL=NoopMeter.d.ts.map
|