nestjs-otel 6.1.0 → 6.1.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/CONTRIBUTING.md +69 -0
- package/README.md +3 -4
- package/lib/metrics/decorators/common.d.ts +3 -1
- package/lib/metrics/decorators/index.d.ts +1 -3
- package/lib/metrics/decorators/index.js +1 -3
- package/lib/metrics/decorators/param.d.ts +8 -0
- package/lib/metrics/decorators/param.js +21 -0
- package/lib/metrics/injector.js +1 -2
- package/lib/metrics/metric-data.js +7 -7
- package/lib/metrics/utils.js +1 -2
- package/lib/tracing/decorators/span.js +1 -2
- package/package.json +26 -32
- package/lib/metrics/decorators/counter.d.ts +0 -2
- package/lib/metrics/decorators/counter.js +0 -17
- package/lib/metrics/decorators/histogram.d.ts +0 -1
- package/lib/metrics/decorators/histogram.js +0 -11
- package/lib/metrics/decorators/observable.d.ts +0 -3
- package/lib/metrics/decorators/observable.js +0 -23
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Contributing Guide
|
|
2
|
+
|
|
3
|
+
We'd love your help!
|
|
4
|
+
|
|
5
|
+
- [Contributing Guide](#contributing-guide)
|
|
6
|
+
- [Development Quick Start](#development-quick-start)
|
|
7
|
+
- [Report a bug or requesting feature](#report-a-bug-or-requesting-feature)
|
|
8
|
+
- [How to contribute](#how-to-contribute)
|
|
9
|
+
- [Conventional commit](#conventional-commit)
|
|
10
|
+
- [Fork](#fork)
|
|
11
|
+
|
|
12
|
+
## Development Quick Start
|
|
13
|
+
|
|
14
|
+
To get the project started quickly, you can follow these steps. For more
|
|
15
|
+
detailed instructions, see [development](#development) below.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
git clone https://github.com/pragmaticivan/nestjs-otel.git
|
|
19
|
+
cd nestjs-otel
|
|
20
|
+
npm ci
|
|
21
|
+
npm run test
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Report a bug or requesting feature
|
|
25
|
+
|
|
26
|
+
Reporting bugs is an important contribution. Please make sure to include:
|
|
27
|
+
|
|
28
|
+
- expected and actual behavior.
|
|
29
|
+
- Node version that application is running.
|
|
30
|
+
- OpenTelemetry version that application is using.
|
|
31
|
+
- if possible - repro application and steps to reproduce.
|
|
32
|
+
|
|
33
|
+
## How to contribute
|
|
34
|
+
|
|
35
|
+
#### Conventional commit
|
|
36
|
+
|
|
37
|
+
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages. You can see examples [here](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#examples).
|
|
38
|
+
We use [commitlint](https://github.com/conventional-changelog/commitlint) and [husky](https://github.com/typicode/husky) to prevent bad commit message.
|
|
39
|
+
For example, you want to submit the following commit message `git commit -s -am "my bad commit"`.
|
|
40
|
+
You will receive the following error :
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
✖ type must be one of [ci, feat, fix, docs, style, refactor, perf, test, revert, chore] [type-enum]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Here an example that will pass the verification: `git commit -s -am "chore(opentelemetry): update deps"`
|
|
47
|
+
|
|
48
|
+
### Fork
|
|
49
|
+
|
|
50
|
+
In the interest of keeping this repository clean and manageable, you should work from a fork. To create a fork, click the 'Fork' button at the top of the repository, then clone the fork locally using `git clone git@github.com:USERNAME/nestjs-otel.git`.
|
|
51
|
+
|
|
52
|
+
You should also add this repository as an "upstream" repo to your local copy, in order to keep it up to date. You can add this as a remote like so:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
git remote add upstream https://github.com/pragmaticivan/nestjs-otel.git
|
|
56
|
+
|
|
57
|
+
#verify that the upstream exists
|
|
58
|
+
git remote -v
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
To update your fork, fetch the upstream repo's branches and commits, then merge your main with upstream's main:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
git fetch upstream
|
|
65
|
+
git checkout main
|
|
66
|
+
git merge upstream/main
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main.
|
package/README.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
</p>
|
|
1
|
+

|
|
2
|
+
|
|
4
3
|
|
|
5
4
|
# NestJS OpenTelemetry (OTEL)
|
|
6
5
|
|
|
@@ -186,7 +185,7 @@ export class BookService {
|
|
|
186
185
|
|
|
187
186
|
## Metric Service
|
|
188
187
|
|
|
189
|
-
[OpenTelemetry Metrics](https://www.npmjs.com/package/@opentelemetry/api
|
|
188
|
+
[OpenTelemetry Metrics](https://www.npmjs.com/package/@opentelemetry/api) allow a user to collect data and export it to metrics backend like Prometheus.
|
|
190
189
|
|
|
191
190
|
```ts
|
|
192
191
|
import { MetricService } from 'nestjs-otel';
|
|
@@ -4,7 +4,9 @@ import { OtelMetricOptions } from '../../interfaces/metric-options.interface';
|
|
|
4
4
|
*
|
|
5
5
|
* @param originalClass
|
|
6
6
|
*/
|
|
7
|
-
export declare const OtelInstanceCounter: (options?: OtelMetricOptions) => <T extends
|
|
7
|
+
export declare const OtelInstanceCounter: (options?: OtelMetricOptions) => <T extends {
|
|
8
|
+
new (...args: any[]): {};
|
|
9
|
+
}>(originalClass: T) => {
|
|
8
10
|
new (...args: any[]): {};
|
|
9
11
|
} & T;
|
|
10
12
|
/**
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./common"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./
|
|
6
|
-
tslib_1.__exportStar(require("./histogram"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./observable"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./param"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OtelMetricOptions } from '../../interfaces/metric-options.interface';
|
|
2
|
+
export type MetricParamDecorator = (name: string, options?: OtelMetricOptions) => ParameterDecorator;
|
|
3
|
+
export declare const OtelCounter: MetricParamDecorator;
|
|
4
|
+
export declare const OtelUpDownCounter: MetricParamDecorator;
|
|
5
|
+
export declare const OtelHistogram: MetricParamDecorator;
|
|
6
|
+
export declare const OtelObservableGauge: MetricParamDecorator;
|
|
7
|
+
export declare const OtelObservableCounter: MetricParamDecorator;
|
|
8
|
+
export declare const OtelObservableUpDownCounter: MetricParamDecorator;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OtelObservableUpDownCounter = exports.OtelObservableCounter = exports.OtelObservableGauge = exports.OtelHistogram = exports.OtelUpDownCounter = exports.OtelCounter = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const metric_data_1 = require("../metric-data");
|
|
6
|
+
function createMetricParamDecorator(type, getOrCreateMetric) {
|
|
7
|
+
return (name, options) => {
|
|
8
|
+
return (0, common_1.createParamDecorator)(() => {
|
|
9
|
+
if (!name || name.length === 0) {
|
|
10
|
+
throw new Error(`${type} need a name argument`);
|
|
11
|
+
}
|
|
12
|
+
return getOrCreateMetric(name, options);
|
|
13
|
+
})();
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.OtelCounter = createMetricParamDecorator('OtelCounter', metric_data_1.getOrCreateCounter);
|
|
17
|
+
exports.OtelUpDownCounter = createMetricParamDecorator('OtelUpDownCounter', metric_data_1.getOrCreateCounter);
|
|
18
|
+
exports.OtelHistogram = createMetricParamDecorator('OtelHistogram', metric_data_1.getOrCreateHistogram);
|
|
19
|
+
exports.OtelObservableGauge = createMetricParamDecorator('OtelObservableGauge', metric_data_1.getOrCreateObservableGauge);
|
|
20
|
+
exports.OtelObservableCounter = createMetricParamDecorator('OtelObservableCounter', metric_data_1.getOrCreateObservableCounter);
|
|
21
|
+
exports.OtelObservableUpDownCounter = createMetricParamDecorator('OtelObservableUpDownCounter', metric_data_1.getOrCreateObservableUpDownCounter);
|
package/lib/metrics/injector.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InjectMetric =
|
|
3
|
+
exports.InjectMetric = InjectMetric;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
6
|
function InjectMetric(name) {
|
|
7
7
|
const token = (0, utils_1.getToken)(name);
|
|
8
8
|
return (0, common_1.Inject)(token);
|
|
9
9
|
}
|
|
10
|
-
exports.InjectMetric = InjectMetric;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.meterData = exports.MetricType = void 0;
|
|
4
|
+
exports.getOrCreateHistogram = getOrCreateHistogram;
|
|
5
|
+
exports.getOrCreateCounter = getOrCreateCounter;
|
|
6
|
+
exports.getOrCreateUpDownCounter = getOrCreateUpDownCounter;
|
|
7
|
+
exports.getOrCreateObservableGauge = getOrCreateObservableGauge;
|
|
8
|
+
exports.getOrCreateObservableCounter = getOrCreateObservableCounter;
|
|
9
|
+
exports.getOrCreateObservableUpDownCounter = getOrCreateObservableUpDownCounter;
|
|
4
10
|
const api_1 = require("@opentelemetry/api");
|
|
5
11
|
const opentelemetry_constants_1 = require("../opentelemetry.constants");
|
|
6
12
|
var MetricType;
|
|
@@ -26,24 +32,18 @@ function getOrCreate(name, options = {}, type) {
|
|
|
26
32
|
function getOrCreateHistogram(name, options = {}) {
|
|
27
33
|
return getOrCreate(name, options, MetricType.Histogram);
|
|
28
34
|
}
|
|
29
|
-
exports.getOrCreateHistogram = getOrCreateHistogram;
|
|
30
35
|
function getOrCreateCounter(name, options = {}) {
|
|
31
36
|
return getOrCreate(name, options, MetricType.Counter);
|
|
32
37
|
}
|
|
33
|
-
exports.getOrCreateCounter = getOrCreateCounter;
|
|
34
38
|
function getOrCreateUpDownCounter(name, options = {}) {
|
|
35
39
|
return getOrCreate(name, options, MetricType.UpDownCounter);
|
|
36
40
|
}
|
|
37
|
-
exports.getOrCreateUpDownCounter = getOrCreateUpDownCounter;
|
|
38
41
|
function getOrCreateObservableGauge(name, options = {}) {
|
|
39
42
|
return getOrCreate(name, options, MetricType.ObservableGauge);
|
|
40
43
|
}
|
|
41
|
-
exports.getOrCreateObservableGauge = getOrCreateObservableGauge;
|
|
42
44
|
function getOrCreateObservableCounter(name, options = {}) {
|
|
43
45
|
return getOrCreate(name, options, MetricType.ObservableCounter);
|
|
44
46
|
}
|
|
45
|
-
exports.getOrCreateObservableCounter = getOrCreateObservableCounter;
|
|
46
47
|
function getOrCreateObservableUpDownCounter(name, options = {}) {
|
|
47
48
|
return getOrCreate(name, options, MetricType.ObservableUpDownCounter);
|
|
48
49
|
}
|
|
49
|
-
exports.getOrCreateObservableUpDownCounter = getOrCreateObservableUpDownCounter;
|
package/lib/metrics/utils.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getToken =
|
|
3
|
+
exports.getToken = getToken;
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
7
|
function getToken(name) {
|
|
8
8
|
return `OTEL_METRIC_${name.toUpperCase()}`;
|
|
9
9
|
}
|
|
10
|
-
exports.getToken = getToken;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Span =
|
|
3
|
+
exports.Span = Span;
|
|
4
4
|
const api_1 = require("@opentelemetry/api");
|
|
5
5
|
const opentelemetry_utils_1 = require("../../opentelemetry.utils");
|
|
6
6
|
const recordException = (span, error) => {
|
|
@@ -46,4 +46,3 @@ function Span(name, options = {}) {
|
|
|
46
46
|
(0, opentelemetry_utils_1.copyMetadataFromFunctionToFunction)(originalFunction, wrappedFunction);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
exports.Span = Span;
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-otel",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"description": "NestJS OpenTelemetry Library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"prebuild": "rimraf lib",
|
|
9
|
-
"prepare": "husky install",
|
|
10
9
|
"build": "tsc",
|
|
11
10
|
"lint": "prettier --check ./**/*.{js,json,ts}",
|
|
12
11
|
"format": "prettier --write ./**/*.{js,json,ts}",
|
|
@@ -15,7 +14,8 @@
|
|
|
15
14
|
"test:unit": "jest --passWithNoTests",
|
|
16
15
|
"test:watch": "jest --watch",
|
|
17
16
|
"test:e2e": "jest --config ./tests/jest-e2e.json --runInBand --forceExit",
|
|
18
|
-
"test:e2e:watch": "jest --config ./tests/jest-e2e.json --runInBand --watch"
|
|
17
|
+
"test:e2e:watch": "jest --config ./tests/jest-e2e.json --runInBand --watch",
|
|
18
|
+
"prepare": "husky"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -36,40 +36,39 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/pragmaticivan/nestjs-otel#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@opentelemetry/api": "^1.
|
|
40
|
-
"@opentelemetry/host-metrics": "^0.35.
|
|
41
|
-
"response-time": "^2.3.
|
|
39
|
+
"@opentelemetry/api": "^1.9.0",
|
|
40
|
+
"@opentelemetry/host-metrics": "^0.35.4",
|
|
41
|
+
"response-time": "^2.3.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@commitlint/cli": "^19.
|
|
45
|
-
"@commitlint/config-conventional": "^19.
|
|
46
|
-
"@nestjs/common": "^10.
|
|
47
|
-
"@nestjs/core": "^10.
|
|
48
|
-
"@nestjs/platform-express": "^10.
|
|
49
|
-
"@nestjs/platform-fastify": "^10.
|
|
50
|
-
"@nestjs/testing": "^10.
|
|
51
|
-
"@opentelemetry/exporter-prometheus": "^0.
|
|
52
|
-
"@opentelemetry/sdk-metrics": "^1.
|
|
53
|
-
"@opentelemetry/sdk-trace-node": "^1.
|
|
54
|
-
"@types/jest": "^29.5.
|
|
55
|
-
"@types/node": "^
|
|
44
|
+
"@commitlint/cli": "^19.5.0",
|
|
45
|
+
"@commitlint/config-conventional": "^19.5.0",
|
|
46
|
+
"@nestjs/common": "^10.4.8",
|
|
47
|
+
"@nestjs/core": "^10.4.8",
|
|
48
|
+
"@nestjs/platform-express": "^10.4.8",
|
|
49
|
+
"@nestjs/platform-fastify": "^10.4.8",
|
|
50
|
+
"@nestjs/testing": "^10.4.8",
|
|
51
|
+
"@opentelemetry/exporter-prometheus": "^0.54.2",
|
|
52
|
+
"@opentelemetry/sdk-metrics": "^1.27.0",
|
|
53
|
+
"@opentelemetry/sdk-trace-node": "^1.27.0",
|
|
54
|
+
"@types/jest": "^29.5.14",
|
|
55
|
+
"@types/node": "^22.9.0",
|
|
56
56
|
"@types/response-time": "^2.3.8",
|
|
57
57
|
"@types/supertest": "^6.0.2",
|
|
58
|
-
"
|
|
59
|
-
"husky": "^9.0.11",
|
|
58
|
+
"husky": "^9.1.6",
|
|
60
59
|
"jest": "^29.7.0",
|
|
61
|
-
"lint-staged": "^15.2.
|
|
62
|
-
"prettier": "^3.
|
|
60
|
+
"lint-staged": "^15.2.10",
|
|
61
|
+
"prettier": "^3.3.3",
|
|
63
62
|
"reflect-metadata": "^0.2.2",
|
|
64
|
-
"rimraf": "^
|
|
63
|
+
"rimraf": "^6.0.1",
|
|
65
64
|
"rxjs": "^7.8.1",
|
|
66
65
|
"supertest": "^7.0.0",
|
|
67
|
-
"ts-jest": "^29.
|
|
68
|
-
"typescript": "5.
|
|
66
|
+
"ts-jest": "^29.2.5",
|
|
67
|
+
"typescript": "5.6.3"
|
|
69
68
|
},
|
|
70
69
|
"peerDependencies": {
|
|
71
|
-
"@nestjs/common": "^9.0.0 || ^10.0.0",
|
|
72
|
-
"@nestjs/core": "^9.0.0 || ^10.0.0"
|
|
70
|
+
"@nestjs/common": "^9.0.0 || ^10.0.0 || ^11.0.0",
|
|
71
|
+
"@nestjs/core": "^9.0.0 || ^10.0.0 || ^11.0.0"
|
|
73
72
|
},
|
|
74
73
|
"jest": {
|
|
75
74
|
"moduleFileExtensions": [
|
|
@@ -93,10 +92,5 @@
|
|
|
93
92
|
"**/*.{js,ts,json}": [
|
|
94
93
|
"prettier --write"
|
|
95
94
|
]
|
|
96
|
-
},
|
|
97
|
-
"commitlint": {
|
|
98
|
-
"extends": [
|
|
99
|
-
"@commitlint/config-conventional"
|
|
100
|
-
]
|
|
101
95
|
}
|
|
102
96
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const OtelCounter: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
2
|
-
export declare const OtelUpDownCounter: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OtelUpDownCounter = exports.OtelCounter = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const metric_data_1 = require("../metric-data");
|
|
6
|
-
exports.OtelCounter = (0, common_1.createParamDecorator)((name, options) => {
|
|
7
|
-
if (!name || name.length === 0) {
|
|
8
|
-
throw new Error('OtelCounter need a name argument');
|
|
9
|
-
}
|
|
10
|
-
return (0, metric_data_1.getOrCreateCounter)(name, options);
|
|
11
|
-
});
|
|
12
|
-
exports.OtelUpDownCounter = (0, common_1.createParamDecorator)((name, options) => {
|
|
13
|
-
if (!name || name.length === 0) {
|
|
14
|
-
throw new Error('OtelUpDownCounter need a name argument');
|
|
15
|
-
}
|
|
16
|
-
return (0, metric_data_1.getOrCreateCounter)(name, options);
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const OtelHistogram: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OtelHistogram = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const metric_data_1 = require("../metric-data");
|
|
6
|
-
exports.OtelHistogram = (0, common_1.createParamDecorator)((name, options) => {
|
|
7
|
-
if (!name || name.length === 0) {
|
|
8
|
-
throw new Error('OtelHistogram need a name argument');
|
|
9
|
-
}
|
|
10
|
-
return (0, metric_data_1.getOrCreateHistogram)(name, options);
|
|
11
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const OtelObservableGauge: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
2
|
-
export declare const OtelObservableCounter: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
3
|
-
export declare const OtelObservableUpDownCounter: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OtelObservableUpDownCounter = exports.OtelObservableCounter = exports.OtelObservableGauge = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const metric_data_1 = require("../metric-data");
|
|
6
|
-
exports.OtelObservableGauge = (0, common_1.createParamDecorator)((name, options) => {
|
|
7
|
-
if (!name || name.length === 0) {
|
|
8
|
-
throw new Error('OtelObservableGauge need a name argument');
|
|
9
|
-
}
|
|
10
|
-
return (0, metric_data_1.getOrCreateObservableGauge)(name, options);
|
|
11
|
-
});
|
|
12
|
-
exports.OtelObservableCounter = (0, common_1.createParamDecorator)((name, options) => {
|
|
13
|
-
if (!name || name.length === 0) {
|
|
14
|
-
throw new Error('OtelObservableCounter need a name argument');
|
|
15
|
-
}
|
|
16
|
-
return (0, metric_data_1.getOrCreateObservableCounter)(name, options);
|
|
17
|
-
});
|
|
18
|
-
exports.OtelObservableUpDownCounter = (0, common_1.createParamDecorator)((name, options) => {
|
|
19
|
-
if (!name || name.length === 0) {
|
|
20
|
-
throw new Error('OtelObservableUpDownCounter need a name argument');
|
|
21
|
-
}
|
|
22
|
-
return (0, metric_data_1.getOrCreateObservableUpDownCounter)(name, options);
|
|
23
|
-
});
|