@gasket/plugin-elastic-apm 7.3.0 → 7.3.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.
Files changed (2) hide show
  1. package/README.md +27 -9
  2. package/package.json +10 -15
package/README.md CHANGED
@@ -37,7 +37,6 @@ Add a `setup.js` script to the root of your app
37
37
 
38
38
  ```
39
39
  // setup.js
40
- import dotenv from 'dotenv/config';
41
40
  import apm from 'elastic-apm-node';
42
41
 
43
42
  // Elastic APM setup
@@ -53,7 +52,7 @@ apm.start({
53
52
  ## Configuration
54
53
 
55
54
  The [start recommendations] for the APM agent are to require it as early as
56
- possible in your app. For Gasket apps, using `--require ./setup.js`
55
+ possible in your app. For Gasket apps, using `NODE_OPTIONS=--import=./setup.js`
57
56
  will accomplish this. To configure the APM agent, set the environment variables
58
57
  described in the [configuration options documentation].
59
58
 
@@ -61,6 +60,24 @@ In particular, the APM server URL (`ELASTIC_APM_SERVER_URL`) and secret token
61
60
  (`ELASTIC_APM_SECRET_TOKEN`) are both required configuration. If either of these
62
61
  are not present, the APM agent will be disabled.
63
62
 
63
+ ### Dotenv
64
+
65
+ If you wish to use `dotenv`, be sure it is installed and imported in `setup.js`:
66
+
67
+ ```
68
+ npm i dotenv
69
+ ```
70
+
71
+ ```diff
72
+ // setup.js
73
+ + import 'dotenv/config';
74
+ import apm from 'elastic-apm-node';
75
+
76
+ // Elastic APM setup
77
+ apm.start({
78
+ ...
79
+ ```
80
+
64
81
  ### Plugin Configurations
65
82
 
66
83
  The Gasket plugin provides some additional setup helpers. These can be
@@ -90,14 +107,14 @@ information in their cookies, you may wish to filter them out before they are
90
107
  stored in Elasticsearch. Specify a list of cookie names to redact in
91
108
  `setup.js` using the [sanitizeFieldNames] configuration option:
92
109
 
93
- ```
110
+ ```diff
94
111
  // setup.js
95
- require('dotenv').config();
112
+ import apm from 'elastic-apm-node';
96
113
 
97
- require('elastic-apm-node').start({
98
- ...,
99
- sanitizeFieldNames: ['foo', 'bar', '*token*']
100
- });
114
+ // Elastic APM setup
115
+ apm.start({
116
+ + sanitizeFieldNames: ['foo', 'bar', '*token*']
117
+ ...
101
118
  ```
102
119
 
103
120
  The `sanitizeFieldNames` config option can be used for:
@@ -111,7 +128,8 @@ To filter out other data, use the [APM Add Filter API].
111
128
  ### Custom Filters
112
129
 
113
130
  According to the [Elastic APM docs], the _Elastic APM agent for Node.js is a
114
- singleton_. This means that you can require and configure singleton in various
131
+ singleton_.
132
+ This means that you can import and configure the singleton in various
115
133
  hooks of your Gasket app, such as with the [init] or [middleware] lifecycles.
116
134
 
117
135
  ## Actions
package/package.json CHANGED
@@ -1,33 +1,28 @@
1
1
  {
2
2
  "name": "@gasket/plugin-elastic-apm",
3
- "version": "7.3.0",
3
+ "version": "7.3.2",
4
4
  "description": "Adds Elastic APM instrumentation to your application",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
8
8
  "lib"
9
9
  ],
10
- "repository": {
11
- "type": "git",
12
- "url": "git+ssh://git@github.com/godaddy/gasket.git"
13
- },
10
+ "repository": "godaddy/gasket.git",
14
11
  "publishConfig": {
15
12
  "access": "public"
16
13
  },
17
14
  "keywords": [
18
- "elastic",
19
15
  "apm",
16
+ "elastic",
20
17
  "gasket",
21
18
  "plugin"
22
19
  ],
23
20
  "author": "GoDaddy Operating Company, LLC",
24
21
  "license": "MIT",
25
- "bugs": {
26
- "url": "https://github.com/godaddy/gasket/issues"
27
- },
22
+ "bugs": "https://github.com/godaddy/gasket/issues",
28
23
  "homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-elastic-apm",
29
24
  "dependencies": {
30
- "@gasket/request": "^7.3.0"
25
+ "@gasket/request": "7.3.3"
31
26
  },
32
27
  "devDependencies": {
33
28
  "@types/jest": "^29.5.14",
@@ -43,9 +38,9 @@
43
38
  "jest": "^29.7.0",
44
39
  "nyc": "^15.1.0",
45
40
  "typescript": "^5.7.3",
46
- "@gasket/core": "^7.3.0",
47
- "@gasket/plugin-metadata": "^7.3.0",
48
- "create-gasket-app": "^7.3.0"
41
+ "@gasket/core": "7.3.2",
42
+ "@gasket/plugin-metadata": "7.3.4",
43
+ "create-gasket-app": "7.3.3"
49
44
  },
50
45
  "eslintConfig": {
51
46
  "extends": [
@@ -80,10 +75,10 @@
80
75
  "scripts": {
81
76
  "lint": "eslint .",
82
77
  "lint:fix": "pnpm run lint --fix",
78
+ "posttest": "pnpm run lint && pnpm run typecheck",
83
79
  "test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict' jest",
84
- "test:watch": "pnpm run test --watch",
85
80
  "test:coverage": "pnpm run test --coverage",
86
- "posttest": "pnpm run lint && pnpm run typecheck",
81
+ "test:watch": "pnpm run test --watch",
87
82
  "typecheck": "tsc",
88
83
  "typecheck:watch": "tsc --watch"
89
84
  }