@boxyhq/metrics 0.2.3 → 0.2.5
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/package.json +10 -10
- package/dist/package.json +0 -48
- package/dist/test/index.d.ts +0 -1
- package/dist/test/index.js +0 -56
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/init.d.ts → init.d.ts} +0 -0
- /package/dist/{src/init.js → init.js} +0 -0
- /package/dist/{src/instruments → instruments}/counter.d.ts +0 -0
- /package/dist/{src/instruments → instruments}/counter.js +0 -0
- /package/dist/{src/instruments → instruments}/gauge.d.ts +0 -0
- /package/dist/{src/instruments → instruments}/gauge.js +0 -0
- /package/dist/{src/instruments → instruments}/histogram.d.ts +0 -0
- /package/dist/{src/instruments → instruments}/histogram.js +0 -0
- /package/dist/{src/instruments → instruments}/index.d.ts +0 -0
- /package/dist/{src/instruments → instruments}/index.js +0 -0
- /package/dist/{src/instruments → instruments}/instrument.d.ts +0 -0
- /package/dist/{src/instruments → instruments}/instrument.js +0 -0
- /package/dist/{src/instruments → instruments}/timer.d.ts +0 -0
- /package/dist/{src/instruments → instruments}/timer.js +0 -0
- /package/dist/{src/lib → lib}/meter.d.ts +0 -0
- /package/dist/{src/lib → lib}/meter.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boxyhq/metrics",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Internal SDK for OTel instrumentation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -28,21 +28,21 @@
|
|
|
28
28
|
"homepage": "https://github.com/boxyhq/metrics#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@opentelemetry/api": "1.4.1",
|
|
31
|
-
"@opentelemetry/exporter-metrics-otlp-grpc": "0.
|
|
32
|
-
"@opentelemetry/exporter-metrics-otlp-http": "0.
|
|
33
|
-
"@opentelemetry/resources": "1.
|
|
34
|
-
"@opentelemetry/sdk-metrics": "1.
|
|
31
|
+
"@opentelemetry/exporter-metrics-otlp-grpc": "0.41.2",
|
|
32
|
+
"@opentelemetry/exporter-metrics-otlp-http": "0.41.2",
|
|
33
|
+
"@opentelemetry/resources": "1.15.2",
|
|
34
|
+
"@opentelemetry/sdk-metrics": "1.15.2",
|
|
35
35
|
"@opentelemetry/semantic-conventions": "1.14.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@tsconfig/recommended": "1.0.2",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
40
|
-
"@typescript-eslint/parser": "5.
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "5.61.0",
|
|
40
|
+
"@typescript-eslint/parser": "5.61.0",
|
|
41
41
|
"env-cmd": "10.1.0",
|
|
42
|
-
"eslint": "8.
|
|
42
|
+
"eslint": "8.44.0",
|
|
43
43
|
"eslint-config-prettier": "8.8.0",
|
|
44
|
-
"prettier": "
|
|
44
|
+
"prettier": "3.0.3",
|
|
45
45
|
"ts-node": "10.9.1",
|
|
46
|
-
"typescript": "5.
|
|
46
|
+
"typescript": "5.1.6"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/dist/package.json
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@boxyhq/metrics",
|
|
3
|
-
"version": "0.2.3",
|
|
4
|
-
"description": "Internal SDK for OTel instrumentation",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"typings": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc -p tsconfig.json",
|
|
12
|
-
"prepublishOnly": "npm run build",
|
|
13
|
-
"lint": "eslint -c .eslintrc.json --ext .ts ./",
|
|
14
|
-
"test:manual": "env-cmd -f ./test/.env ts-node --project tsconfig.json test/index.ts"
|
|
15
|
-
},
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/boxyhq/metrics.git"
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"otel",
|
|
22
|
-
"telemetry"
|
|
23
|
-
],
|
|
24
|
-
"license": "Apache-2.0",
|
|
25
|
-
"bugs": {
|
|
26
|
-
"url": "https://github.com/boxyhq/metrics/issues"
|
|
27
|
-
},
|
|
28
|
-
"homepage": "https://github.com/boxyhq/metrics#readme",
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@opentelemetry/api": "1.4.1",
|
|
31
|
-
"@opentelemetry/exporter-metrics-otlp-grpc": "0.40.0",
|
|
32
|
-
"@opentelemetry/exporter-metrics-otlp-http": "0.40.0",
|
|
33
|
-
"@opentelemetry/resources": "1.14.0",
|
|
34
|
-
"@opentelemetry/sdk-metrics": "1.14.0",
|
|
35
|
-
"@opentelemetry/semantic-conventions": "1.14.0"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@tsconfig/recommended": "1.0.2",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "5.58.0",
|
|
40
|
-
"@typescript-eslint/parser": "5.58.0",
|
|
41
|
-
"env-cmd": "10.1.0",
|
|
42
|
-
"eslint": "8.38.0",
|
|
43
|
-
"eslint-config-prettier": "8.8.0",
|
|
44
|
-
"prettier": "2.8.8",
|
|
45
|
-
"ts-node": "10.9.1",
|
|
46
|
-
"typescript": "5.0.4"
|
|
47
|
-
}
|
|
48
|
-
}
|
package/dist/test/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/test/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const src_1 = require("../src");
|
|
16
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
17
|
-
const promises_1 = require("timers/promises");
|
|
18
|
-
const SERVICE_NAME = '@boxyhq/metrics';
|
|
19
|
-
(0, src_1.initializeMetrics)({ name: SERVICE_NAME, version: package_json_1.default.version });
|
|
20
|
-
const METER = 'meter';
|
|
21
|
-
function testInstruments() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
(0, src_1.incrementCounter)({
|
|
24
|
-
meter: METER,
|
|
25
|
-
name: 'test.counter',
|
|
26
|
-
counterOptions: { description: 'Test counter' },
|
|
27
|
-
});
|
|
28
|
-
console.log(`Operation for counter metric ... DONE`);
|
|
29
|
-
(0, src_1.observeGauge)({
|
|
30
|
-
meter: METER,
|
|
31
|
-
name: 'test.gauge',
|
|
32
|
-
gaugeOptions: { description: 'Test gauge', unit: 'm/s' },
|
|
33
|
-
val: 100,
|
|
34
|
-
});
|
|
35
|
-
console.log(`Operation for gauge metric ... DONE`);
|
|
36
|
-
(0, src_1.recordHistogram)({
|
|
37
|
-
meter: METER,
|
|
38
|
-
name: 'test.histogram',
|
|
39
|
-
histogramOptions: { description: 'Test histogram' },
|
|
40
|
-
val: 200,
|
|
41
|
-
});
|
|
42
|
-
console.log(`Operation for histogram metric ... DONE`);
|
|
43
|
-
yield (0, src_1.instrument)({
|
|
44
|
-
meter: METER,
|
|
45
|
-
name: 'test.instrument',
|
|
46
|
-
delegate: () => Promise.resolve(),
|
|
47
|
-
});
|
|
48
|
-
console.log(`Operation for function instrumentation ... DONE`);
|
|
49
|
-
/** Essential to set a timeout below that is more than the export interval*/
|
|
50
|
-
const waitTime = Number(process.env.OTEL_EXPORT_INTERVAL_MS) + 1000 || 61000;
|
|
51
|
-
console.log(`Waiting for ${waitTime}ms to complete export ....`);
|
|
52
|
-
yield (0, promises_1.setTimeout)(waitTime);
|
|
53
|
-
console.log(`Export operation ... COMPLETE, please check the configured OTEL service for recorded values`);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
testInstruments();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|