@gasket/plugin-elastic-apm 7.0.0-next.53 → 7.0.0-next.55
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/actions.js +16 -16
- package/lib/index.d.ts +3 -4
- package/lib/index.js +1 -1
- package/package.json +6 -7
package/lib/actions.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/** @type {import('@gasket/core').
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
async getApmTransaction(req) {
|
|
5
|
-
const apm = require('elastic-apm-node');
|
|
1
|
+
/** @type {import('@gasket/core').ActionHandler<'getApmTransaction'>} */
|
|
2
|
+
async function getApmTransaction(gasket, req) {
|
|
3
|
+
const apm = require('elastic-apm-node');
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
if (!apm?.isStarted()) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const transaction = apm.currentTransaction;
|
|
10
|
+
if (!transaction) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
await gasket.exec('apmTransaction', transaction, { req });
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
return transaction;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = {
|
|
20
|
+
getApmTransaction
|
|
21
21
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { IncomingMessage
|
|
2
|
-
import type { AgentConfigOptions, Transaction, Payload } from 'elastic-apm-node';
|
|
3
|
-
import type { MaybeAsync, GasketConfig,
|
|
4
|
-
import type { GasketData } from '@gasket/data';
|
|
1
|
+
import type { IncomingMessage } from 'http';
|
|
2
|
+
import type { AgentConfigOptions, Transaction, Payload, Agent } from 'elastic-apm-node';
|
|
3
|
+
import type { MaybeAsync, GasketConfig, Plugin } from '@gasket/core';
|
|
5
4
|
import type { Request } from 'express';
|
|
6
5
|
|
|
7
6
|
export function filterSensitiveCookies(config: GasketConfig): function(Payload): Payload;
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/plugin-elastic-apm",
|
|
3
|
-
"version": "7.0.0-next.
|
|
3
|
+
"version": "7.0.0-next.55",
|
|
4
4
|
"description": "Adds Elastic APM instrumentation to your application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"lint:fix": "npm run lint -- --fix",
|
|
13
|
-
"test": "
|
|
14
|
-
"test:
|
|
15
|
-
"test:
|
|
16
|
-
"test:coverage": "npm run test:runner -- --coverage --coverageReporters text",
|
|
13
|
+
"test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict' jest",
|
|
14
|
+
"test:watch": "npm run test -- --watch",
|
|
15
|
+
"test:coverage": "npm run test -- --coverage",
|
|
17
16
|
"posttest": "npm run lint && npm run typecheck",
|
|
18
17
|
"typecheck": "tsc",
|
|
19
18
|
"typecheck:watch": "tsc --watch"
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
},
|
|
42
41
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-elastic-apm",
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@gasket/core": "7.0.0-next.
|
|
43
|
+
"@gasket/core": "7.0.0-next.55",
|
|
45
44
|
"dotenv": "^16.4.5",
|
|
46
45
|
"elastic-apm-node": "^4.4.1",
|
|
47
46
|
"eslint": "^8.56.0",
|
|
@@ -70,5 +69,5 @@
|
|
|
70
69
|
"jest": {
|
|
71
70
|
"testEnvironment": "node"
|
|
72
71
|
},
|
|
73
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "84a2654cf25651972e1bfbb0a54cb9f330ecb3ad"
|
|
74
73
|
}
|