@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.
Files changed (2) hide show
  1. package/README.md +22 -23
  2. 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
- gasket create <app-name> --plugins @gasket/plugin-elastic-apm
8
+ npm i @gasket/plugin-elastic-apm
11
9
  ```
12
10
 
13
- #### Existing apps
11
+ Update your `gasket` file plugin configuration:
14
12
 
15
- ```
16
- npm install @gasket/plugin-elastic-apm elastic-apm-node
17
- ```
13
+ ```diff
14
+ // gasket.js
18
15
 
19
- Modify `plugins` section of your `gasket.config.js`:
16
+ + import pluginElasticApm from '@gasket/plugin-elastic-apm';
20
17
 
21
- ```diff
22
- module.exports = {
23
- plugins: {
24
- add: [
25
- + '@gasket/plugin-elastic-apm'
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.config.js`:
74
+ `gasket.js`:
81
75
 
82
76
  ```js
83
- module.exports = {
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
- // /lifecycles/apm-transaction.js
135
-
136
- module.exports = (gasket, transaction, { req, res }) => {
137
- transaction.setLabel('language', req.headers['accept-language']);
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.42",
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.42",
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": "d96c86a52f608ea702f9b91a5a72f3b19389877c"
73
+ "gitHead": "3a1d51a5e98ce4bad06faa2fceae90c580c8a0a9"
74
74
  }