Skip to content

Commit a524646

Browse files
committed
add new relic
1 parent 18b7aa9 commit a524646

File tree

6 files changed

+1219
-38
lines changed

6 files changed

+1219
-38
lines changed

.env.example

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ SYNCHRONIZE=false
33
LOGGING=true
44
PORT=4000
55
INDEXER_URL=https://grants-stack-indexer-v2.gitcoin.co/
6-
NODE_ENV=development
6+
NODE_ENV=development
7+
8+
NEW_RELIC_APP_NAME=retrofunding-api
9+
NEW_RELIC_LICENSE_KEY=XXXXXXXXXXXXX

newrelic.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'use strict';
2+
3+
/**
4+
* New Relic agent configuration.
5+
* This configuration reads sensitive information from environment variables.
6+
*/
7+
exports.config = {
8+
/**
9+
* Array of application names.
10+
*/
11+
app_name: [process.env.NEW_RELIC_APP_NAME || 'default-app-name'],
12+
13+
/**
14+
* Your New Relic license key.
15+
*/
16+
license_key: process.env.NEW_RELIC_LICENSE_KEY || 'your-default-license-key',
17+
18+
/**
19+
* Logging configuration.
20+
*/
21+
logging: {
22+
/**
23+
* Level at which to log. 'trace' is most useful for diagnosing issues with
24+
* the agent, 'info' and higher will impose the least overhead on production
25+
* applications.
26+
*/
27+
level: process.env.NEW_RELIC_LOG_LEVEL || 'info',
28+
},
29+
30+
/**
31+
* Distributed Tracing.
32+
* Enables distributed tracing, which lets you see the path requests take
33+
* through your distributed system.
34+
*/
35+
distributed_tracing: {
36+
enabled: true,
37+
},
38+
39+
/**
40+
* Error Collector configuration.
41+
* Controls how the agent collects information about errors.
42+
*/
43+
error_collector: {
44+
enabled: true,
45+
},
46+
47+
/**
48+
* Custom Insights configuration.
49+
* Controls how custom events are sent to New Relic Insights.
50+
*/
51+
insights: {
52+
enabled: true,
53+
},
54+
55+
/**
56+
* Allow using environment variables for sensitive data.
57+
*/
58+
allow_all_headers: true,
59+
};

newrelic_agent.log

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27047,"time":"2025-01-21T09:48:56.358Z","msg":"Unable to find configuration file. If a configuration file is desired (common for non-containerized environments), a base configuration file can be copied from /Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/newrelic.js and renamed to \"newrelic.js\" in the directory from which you will start your application. Attempting to start agent using environment variables."}
2+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27047,"time":"2025-01-21T09:48:56.361Z","msg":"Using New Relic for Node.js. Agent version: 12.11.1; Node version: v23.6.0."}
3+
{"v":0,"level":40,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27047,"time":"2025-01-21T09:48:56.363Z","msg":"New Relic for Node.js 12.11.1 has not been tested on Node.js v23.6.0. Please update the agent or downgrade your version of Node.js"}
4+
{"v":0,"level":50,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27047,"time":"2025-01-21T09:48:56.394Z","msg":"New Relic for Node.js was unable to bootstrap itself due to an error:","stack":"Error: New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!\n at createAgent (/Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/index.js:157:11)\n at initialize (/Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/index.js:104:15)\n at Object.<anonymous> (/Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/index.js:38:3)\n at Module._compile (node:internal/modules/cjs/loader:1739:14)\n at Object..js (node:internal/modules/cjs/loader:1904:10)\n at Module.load (node:internal/modules/cjs/loader:1473:32)\n at Function._load (node:internal/modules/cjs/loader:1285:12)\n at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)\n at Module.require (node:internal/modules/cjs/loader:1495:12)","message":"New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!"}
5+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27181,"time":"2025-01-21T09:50:04.601Z","msg":"Unable to find configuration file. If a configuration file is desired (common for non-containerized environments), a base configuration file can be copied from /Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/newrelic.js and renamed to \"newrelic.js\" in the directory from which you will start your application. Attempting to start agent using environment variables."}
6+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27181,"time":"2025-01-21T09:50:04.605Z","msg":"Using New Relic for Node.js. Agent version: 12.11.1; Node version: v23.6.0."}
7+
{"v":0,"level":40,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27181,"time":"2025-01-21T09:50:04.606Z","msg":"New Relic for Node.js 12.11.1 has not been tested on Node.js v23.6.0. Please update the agent or downgrade your version of Node.js"}
8+
{"v":0,"level":50,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27181,"time":"2025-01-21T09:50:04.631Z","msg":"New Relic for Node.js was unable to bootstrap itself due to an error:","stack":"Error: New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!\n at createAgent (/Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/index.js:157:11)\n at initialize (/Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/index.js:104:15)\n at Object.<anonymous> (/Users/kurt/git/gitcoin/retrofunding-api/node_modules/newrelic/index.js:38:3)\n at Module._compile (node:internal/modules/cjs/loader:1739:14)\n at Object..js (node:internal/modules/cjs/loader:1904:10)\n at Module.load (node:internal/modules/cjs/loader:1473:32)\n at Function._load (node:internal/modules/cjs/loader:1285:12)\n at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)\n at Module.require (node:internal/modules/cjs/loader:1495:12)","message":"New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!"}
9+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:51:59.085Z","msg":"Using New Relic for Node.js. Agent version: 12.11.1; Node version: v23.6.0."}
10+
{"v":0,"level":40,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:51:59.087Z","msg":"New Relic for Node.js 12.11.1 has not been tested on Node.js v23.6.0. Please update the agent or downgrade your version of Node.js"}
11+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:51:59.123Z","msg":"Agent state changed from stopped to starting."}
12+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:51:59.345Z","msg":"Starting New Relic for Node.js connection process."}
13+
{"v":0,"level":30,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:51:59.345Z","msg":"Agent state changed from starting to connecting."}
14+
{"v":0,"level":40,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:52:01.048Z","msg":"Your license key appears to be invalid. Reattempting connection to New Relic. If the problem persists, please contact support@newrelic.com. (status code 401)","component":"collector_api"}
15+
{"v":0,"level":40,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:52:16.528Z","msg":"Your license key appears to be invalid. Reattempting connection to New Relic. If the problem persists, please contact support@newrelic.com. (status code 401)","component":"collector_api"}
16+
{"v":0,"level":40,"name":"newrelic","hostname":"Kurts-MacBook-Pro.local","pid":27316,"time":"2025-01-21T09:52:31.675Z","msg":"Your license key appears to be invalid. Reattempting connection to New Relic. If the problem persists, please contact support@newrelic.com. (status code 401)","component":"collector_api"}

0 commit comments

Comments
 (0)