@autofleet/nitur 1.1.4 → 1.2.1
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/lib/cloud-profiler/index.d.ts +1 -0
- package/lib/cloud-profiler/index.js +19 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cloudProfilerReporter: (options?: any) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cloudProfilerReporter = void 0;
|
|
7
|
+
const profiler_1 = __importDefault(require("@google-cloud/profiler"));
|
|
8
|
+
const defaultOptions = {
|
|
9
|
+
service: process.env.AF_SERVICE_NAME,
|
|
10
|
+
version: process.env.VERSION,
|
|
11
|
+
};
|
|
12
|
+
exports.cloudProfilerReporter = (options) => {
|
|
13
|
+
profiler_1.default.start({
|
|
14
|
+
serviceContext: {
|
|
15
|
+
service: (options === null || options === void 0 ? void 0 : options.service) || defaultOptions.service,
|
|
16
|
+
version: (options === null || options === void 0 ? void 0 : options.version) || defaultOptions.version,
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -22,8 +22,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.aliveEndpoint = exports.newrelic = void 0;
|
|
25
|
+
exports.cloudProfiler = exports.aliveEndpoint = exports.newrelic = void 0;
|
|
26
26
|
const newrelic = __importStar(require("./newrelic"));
|
|
27
27
|
exports.newrelic = newrelic;
|
|
28
28
|
const alive_endpoint_1 = __importDefault(require("./alive-endpoint"));
|
|
29
29
|
exports.aliveEndpoint = alive_endpoint_1.default;
|
|
30
|
+
const cloudProfiler = __importStar(require("./cloud-profiler"));
|
|
31
|
+
exports.cloudProfiler = cloudProfiler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/nitur",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A package for service monitoring",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@autofleet/logger": "^1.2.8",
|
|
36
|
-
"
|
|
36
|
+
"@google-cloud/profiler": "^4.1.7",
|
|
37
|
+
"newrelic": "^4.10.0"
|
|
37
38
|
}
|
|
38
39
|
}
|