@gasket/plugin-elastic-apm 7.0.0-next.42 → 7.0.0-next.44
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/README.md +22 -23
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,28 +4,22 @@ Adds Elastic APM instrumentation to your application
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
#### New apps
|
|
8
|
-
|
|
9
7
|
```
|
|
10
|
-
|
|
8
|
+
npm i @gasket/plugin-elastic-apm
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
Update your `gasket` file plugin configuration:
|
|
14
12
|
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
```
|
|
13
|
+
```diff
|
|
14
|
+
// gasket.js
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
+ import pluginElasticApm from '@gasket/plugin-elastic-apm';
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|
|
18
|
+
export default makeGasket({
|
|
19
|
+
plugins: [
|
|
20
|
+
+ pluginElasticApm
|
|
21
|
+
]
|
|
22
|
+
});
|
|
29
23
|
```
|
|
30
24
|
|
|
31
25
|
Add a `--require` flag to a `package.json` start script:
|
|
@@ -77,14 +71,14 @@ configured under `elasticAPM` in the `gasket.config.js`.
|
|
|
77
71
|
If your application’s users send session credentials or any other sensitive
|
|
78
72
|
information in their cookies, you may wish to filter them out before they are
|
|
79
73
|
stored in Elasticsearch. Specify a list of cookie names to redact in
|
|
80
|
-
`gasket.
|
|
74
|
+
`gasket.js`:
|
|
81
75
|
|
|
82
76
|
```js
|
|
83
|
-
|
|
77
|
+
export default makeGasket({
|
|
84
78
|
elasticAPM: {
|
|
85
79
|
sensitiveCookies: ['my_jwt', 'userFullName']
|
|
86
80
|
}
|
|
87
|
-
};
|
|
81
|
+
});
|
|
88
82
|
```
|
|
89
83
|
|
|
90
84
|
#### Custom Filtering Sensitive Fields
|
|
@@ -131,10 +125,15 @@ request details are as follows:
|
|
|
131
125
|
| `res` | The HTTP response or framework-specific wrapper around it |
|
|
132
126
|
|
|
133
127
|
```javascript
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
// example-plugin.js
|
|
129
|
+
|
|
130
|
+
export default {
|
|
131
|
+
name: 'example-plugin',
|
|
132
|
+
hooks: {
|
|
133
|
+
apmTransaction(gasket, transaction, { req, res }) => {
|
|
134
|
+
transaction.setLabel('language', req.headers['accept-language']);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
138
137
|
}
|
|
139
138
|
```
|
|
140
139
|
|
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.44",
|
|
4
4
|
"description": "Adds Elastic APM instrumentation to your application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-elastic-apm",
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@gasket/core": "^7.0.0-next.
|
|
45
|
+
"@gasket/core": "^7.0.0-next.44",
|
|
46
46
|
"elastic-apm-node": "^4.4.1",
|
|
47
47
|
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-config-godaddy": "^7.1.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"jest": {
|
|
71
71
|
"testEnvironment": "node"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "3a1d51a5e98ce4bad06faa2fceae90c580c8a0a9"
|
|
74
74
|
}
|