@prairielearn/opentelemetry 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/metrics.test.js +8 -4
- package/dist/metrics.test.js.map +1 -1
- package/package.json +26 -26
- package/src/metrics.test.ts +10 -5
package/CHANGELOG.md
CHANGED
package/dist/metrics.test.js
CHANGED
|
@@ -59,11 +59,12 @@ describe('instrumentedWithMetrics', () => {
|
|
|
59
59
|
await waitForMetricsExport(exporter);
|
|
60
60
|
const exportedMetrics = exporter.getMetrics();
|
|
61
61
|
const { scope, metrics } = exportedMetrics[0].scopeMetrics[0];
|
|
62
|
-
|
|
62
|
+
// We won't see an exported metric for the error counter because the
|
|
63
|
+
// Metrics SDK no longer exports metrics with no data points.
|
|
64
|
+
// https://github.com/open-telemetry/opentelemetry-js/pull/4135
|
|
65
|
+
chai_1.assert.lengthOf(metrics, 1);
|
|
66
|
+
const [histogramMetric] = metrics;
|
|
63
67
|
chai_1.assert.equal(scope.name, 'test');
|
|
64
|
-
chai_1.assert.ok(counterMetric);
|
|
65
|
-
chai_1.assert.equal(counterMetric.descriptor.name, 'test.error');
|
|
66
|
-
chai_1.assert.lengthOf(counterMetric.dataPoints, 0);
|
|
67
68
|
chai_1.assert.ok(histogramMetric);
|
|
68
69
|
chai_1.assert.equal(histogramMetric.descriptor.name, 'test.duration');
|
|
69
70
|
chai_1.assert.equal(histogramMetric.dataPoints[0].value.count, 1);
|
|
@@ -75,6 +76,9 @@ describe('instrumentedWithMetrics', () => {
|
|
|
75
76
|
await waitForMetricsExport(exporter);
|
|
76
77
|
const exportedMetrics = exporter.getMetrics();
|
|
77
78
|
const { metrics, scope } = exportedMetrics[0].scopeMetrics[0];
|
|
79
|
+
// An error was reported above, so there will be both the error counter
|
|
80
|
+
// and histogram metrics.
|
|
81
|
+
chai_1.assert.lengthOf(metrics, 2);
|
|
78
82
|
const [counterMetric, histogramMetric] = metrics;
|
|
79
83
|
chai_1.assert.ok(scope);
|
|
80
84
|
chai_1.assert.equal(scope.name, 'test');
|
package/dist/metrics.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.test.js","sourceRoot":"","sources":["../src/metrics.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAMoC;AAEpC,6CAAoC;AACpC,wEAA8C;AAE9C,uCAAoD;AAEpD,cAAI,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AAEzB,KAAK,UAAU,oBAAoB,CAAC,QAAgC;IAClE,OAAO,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACzC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;KACzD;AACH,CAAC;AAED,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,QAAgC,CAAC;IACrC,IAAI,YAA2C,CAAC;IAChD,IAAI,KAAY,CAAC;IAEjB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,aAAa,GAAG,IAAI,2BAAa,EAAE,CAAC;QAC1C,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvC,QAAQ,GAAG,IAAI,oCAAsB,CAAC,oCAAsB,CAAC,KAAK,CAAC,CAAC;QACpE,YAAY,GAAG,IAAI,2CAA6B,CAAC;YAC/C,QAAQ,EAAE,QAAQ;YAClB,oBAAoB,EAAE,EAAE;SACzB,CAAC,CAAC;QACH,aAAa,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC1B,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;IAChC,C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{
|
|
2
2
|
"name": "@prairielearn/opentelemetry",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,34 +13,34 @@
|
|
|
13
13
|
"test": "mocha --no-config --require ts-node/register src/**/*.test.ts"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@grpc/grpc-js": "^1.9.
|
|
17
|
-
"@opentelemetry/api": "^1.
|
|
18
|
-
"@opentelemetry/core": "^1.
|
|
19
|
-
"@opentelemetry/exporter-jaeger": "^1.
|
|
20
|
-
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.
|
|
21
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
22
|
-
"@opentelemetry/instrumentation": "^0.
|
|
23
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.36.
|
|
24
|
-
"@opentelemetry/instrumentation-connect": "^0.32.
|
|
25
|
-
"@opentelemetry/instrumentation-dns": "^0.32.
|
|
26
|
-
"@opentelemetry/instrumentation-express": "^0.33.
|
|
27
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
28
|
-
"@opentelemetry/instrumentation-pg": "^0.36.
|
|
29
|
-
"@opentelemetry/instrumentation-redis": "^0.35.
|
|
30
|
-
"@opentelemetry/resource-detector-aws": "^1.3.
|
|
31
|
-
"@opentelemetry/resources": "^1.
|
|
32
|
-
"@opentelemetry/sdk-metrics": "^1.
|
|
33
|
-
"@opentelemetry/sdk-node": "^0.
|
|
34
|
-
"@opentelemetry/sdk-trace-base": "^1.
|
|
35
|
-
"@opentelemetry/sdk-trace-node": "^1.
|
|
36
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
16
|
+
"@grpc/grpc-js": "^1.9.7",
|
|
17
|
+
"@opentelemetry/api": "^1.6.0",
|
|
18
|
+
"@opentelemetry/core": "^1.17.1",
|
|
19
|
+
"@opentelemetry/exporter-jaeger": "^1.17.1",
|
|
20
|
+
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.44.0",
|
|
21
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.44.0",
|
|
22
|
+
"@opentelemetry/instrumentation": "^0.44.0",
|
|
23
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.36.1",
|
|
24
|
+
"@opentelemetry/instrumentation-connect": "^0.32.2",
|
|
25
|
+
"@opentelemetry/instrumentation-dns": "^0.32.3",
|
|
26
|
+
"@opentelemetry/instrumentation-express": "^0.33.2",
|
|
27
|
+
"@opentelemetry/instrumentation-http": "^0.44.0",
|
|
28
|
+
"@opentelemetry/instrumentation-pg": "^0.36.2",
|
|
29
|
+
"@opentelemetry/instrumentation-redis": "^0.35.2",
|
|
30
|
+
"@opentelemetry/resource-detector-aws": "^1.3.2",
|
|
31
|
+
"@opentelemetry/resources": "^1.17.1",
|
|
32
|
+
"@opentelemetry/sdk-metrics": "^1.17.1",
|
|
33
|
+
"@opentelemetry/sdk-node": "^0.44.0",
|
|
34
|
+
"@opentelemetry/sdk-trace-base": "^1.17.1",
|
|
35
|
+
"@opentelemetry/sdk-trace-node": "^1.17.1",
|
|
36
|
+
"@opentelemetry/semantic-conventions": "^1.17.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@prairielearn/tsconfig": "^0.0.0",
|
|
40
|
-
"@types/chai": "^4.3.
|
|
41
|
-
"@types/mocha": "^10.0.
|
|
42
|
-
"@types/node": "^18.
|
|
43
|
-
"chai": "^4.3.
|
|
40
|
+
"@types/chai": "^4.3.9",
|
|
41
|
+
"@types/mocha": "^10.0.3",
|
|
42
|
+
"@types/node": "^18.18.7",
|
|
43
|
+
"chai": "^4.3.10",
|
|
44
44
|
"mocha": "^10.2.0",
|
|
45
45
|
"ts-node": "^10.9.1",
|
|
46
46
|
"typescript": "^5.2.2"
|
package/src/metrics.test.ts
CHANGED
|
@@ -46,13 +46,14 @@ describe('instrumentedWithMetrics', () => {
|
|
|
46
46
|
await waitForMetricsExport(exporter);
|
|
47
47
|
const exportedMetrics = exporter.getMetrics();
|
|
48
48
|
const { scope, metrics } = exportedMetrics[0].scopeMetrics[0];
|
|
49
|
-
const [counterMetric, histogramMetric] = metrics;
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
// We won't see an exported metric for the error counter because the
|
|
51
|
+
// Metrics SDK no longer exports metrics with no data points.
|
|
52
|
+
// https://github.com/open-telemetry/opentelemetry-js/pull/4135
|
|
53
|
+
assert.lengthOf(metrics, 1);
|
|
54
|
+
const [histogramMetric] = metrics;
|
|
52
55
|
|
|
53
|
-
assert.
|
|
54
|
-
assert.equal(counterMetric.descriptor.name, 'test.error');
|
|
55
|
-
assert.lengthOf(counterMetric.dataPoints, 0);
|
|
56
|
+
assert.equal(scope.name, 'test');
|
|
56
57
|
|
|
57
58
|
assert.ok(histogramMetric);
|
|
58
59
|
assert.equal(histogramMetric.descriptor.name, 'test.duration');
|
|
@@ -70,6 +71,10 @@ describe('instrumentedWithMetrics', () => {
|
|
|
70
71
|
await waitForMetricsExport(exporter);
|
|
71
72
|
const exportedMetrics = exporter.getMetrics();
|
|
72
73
|
const { metrics, scope } = exportedMetrics[0].scopeMetrics[0];
|
|
74
|
+
|
|
75
|
+
// An error was reported above, so there will be both the error counter
|
|
76
|
+
// and histogram metrics.
|
|
77
|
+
assert.lengthOf(metrics, 2);
|
|
73
78
|
const [counterMetric, histogramMetric] = metrics;
|
|
74
79
|
|
|
75
80
|
assert.ok(scope);
|