feat: remove newrelic integration (#862)

This commit is contained in:
Karol Sójko
2023-10-10 15:07:38 +02:00
committed by GitHub
parent dae7dc9541
commit efb341eb99
135 changed files with 46 additions and 2810 deletions

View File

@@ -20,19 +20,3 @@ jobs:
deploy_web: false deploy_web: false
package_path: packages/analytics package_path: packages/analytics
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_ANALYTICS_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -20,17 +20,3 @@ jobs:
deploy_worker: false deploy_worker: false
package_path: packages/api-gateway package_path: packages/api-gateway
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_API_GATEWAY_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -19,27 +19,3 @@ jobs:
workspace_name: "@standardnotes/auth-server" workspace_name: "@standardnotes/auth-server"
package_path: packages/auth package_path: packages/auth
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -19,27 +19,3 @@ jobs:
workspace_name: "@standardnotes/files-server" workspace_name: "@standardnotes/files-server"
package_path: packages/files package_path: packages/files
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -19,27 +19,3 @@ jobs:
workspace_name: "@standardnotes/revisions-server" workspace_name: "@standardnotes/revisions-server"
package_path: packages/revisions package_path: packages/revisions
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_REVISIONS_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_REVISIONS_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -20,19 +20,3 @@ jobs:
deploy_web: false deploy_web: false
package_path: packages/scheduler package_path: packages/scheduler
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SCHEDULER_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -19,27 +19,3 @@ jobs:
workspace_name: "@standardnotes/syncing-server" workspace_name: "@standardnotes/syncing-server"
package_path: packages/syncing-server package_path: packages/syncing-server
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

View File

@@ -19,27 +19,3 @@ jobs:
workspace_name: "@standardnotes/websockets-server" workspace_name: "@standardnotes/websockets-server"
package_path: packages/websockets package_path: packages/websockets
secrets: inherit secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_WEBSOCKETS_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_WEBSOCKETS_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

1
.gitignore vendored
View File

@@ -4,7 +4,6 @@
dist dist
coverage coverage
.env .env
newrelic_agent.log
.yarn/* .yarn/*
!.yarn/cache !.yarn/cache

1110
.pnp.cjs generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,6 @@ services:
SNS_SECRET_ACCESS_KEY: x SNS_SECRET_ACCESS_KEY: x
SNS_ACCESS_KEY_ID: x SNS_ACCESS_KEY_ID: x
SNS_AWS_REGION: us-east-1 SNS_AWS_REGION: us-east-1
NEW_RELIC_ENABLED: false
networks: networks:
- standardnotes_self_hosted - standardnotes_self_hosted

View File

@@ -24,14 +24,6 @@ if [ -z "$REVISIONS_SERVER_PORT" ]; then
export REVISIONS_SERVER_PORT=3105 export REVISIONS_SERVER_PORT=3105
fi fi
#############
# NEW RELIC #
#############
if [ -z "$NEW_RELIC_ENABLED" ]; then
export NEW_RELIC_ENABLED=false
fi
###### ######
# DB # # DB #
###### ######
@@ -119,10 +111,6 @@ fi
export AUTH_SERVER_JWT_SECRET=$AUTH_JWT_SECRET export AUTH_SERVER_JWT_SECRET=$AUTH_JWT_SECRET
export AUTH_SERVER_LEGACY_JWT_SECRET=$(openssl rand -hex 32) export AUTH_SERVER_LEGACY_JWT_SECRET=$(openssl rand -hex 32)
export AUTH_SERVER_NEW_RELIC_ENABLED=false
export AUTH_SERVER_NEW_RELIC_APP_NAME=Auth
export AUTH_SERVER_NEW_RELIC_NO_CONFIG_FILE=true
if [ -z "$AUTH_SERVER_DISABLE_USER_REGISTRATION" ]; then if [ -z "$AUTH_SERVER_DISABLE_USER_REGISTRATION" ]; then
export AUTH_SERVER_DISABLE_USER_REGISTRATION=false export AUTH_SERVER_DISABLE_USER_REGISTRATION=false
fi fi
@@ -260,10 +248,6 @@ if [ -z "$SYNCING_SERVER_REVISIONS_FREQUENCY" ]; then
export SYNCING_SERVER_REVISIONS_FREQUENCY=300 export SYNCING_SERVER_REVISIONS_FREQUENCY=300
fi fi
export SYNCING_SERVER_NEW_RELIC_ENABLED=false
export SYNCING_SERVER_NEW_RELIC_APP_NAME="Syncing Server JS"
export SYNCING_SERVER_NEW_RELIC_NO_CONFIG_FILE=true
export SYNCING_SERVER_FILE_UPLOAD_PATH="/opt/shared/uploads" export SYNCING_SERVER_FILE_UPLOAD_PATH="/opt/shared/uploads"
printenv | grep SYNCING_SERVER_ | sed 's/SYNCING_SERVER_//g' > /opt/server/packages/syncing-server/.env printenv | grep SYNCING_SERVER_ | sed 's/SYNCING_SERVER_//g' > /opt/server/packages/syncing-server/.env
@@ -283,8 +267,6 @@ if [ -z "$FILES_SERVER_MAX_CHUNK_BYTES" ]; then
export FILES_SERVER_MAX_CHUNK_BYTES=100000000 export FILES_SERVER_MAX_CHUNK_BYTES=100000000
fi fi
export FILES_SERVER_NEW_RELIC_ENABLED=false
if [ -z "$FILES_SERVER_SNS_TOPIC_ARN" ]; then if [ -z "$FILES_SERVER_SNS_TOPIC_ARN" ]; then
export FILES_SERVER_SNS_TOPIC_ARN="arn:aws:sns:us-east-1:000000000000:files-local-topic" export FILES_SERVER_SNS_TOPIC_ARN="arn:aws:sns:us-east-1:000000000000:files-local-topic"
fi fi
@@ -329,8 +311,6 @@ fi
export REVISIONS_SERVER_NODE_ENV="production" export REVISIONS_SERVER_NODE_ENV="production"
export REVISIONS_SERVER_VERSION="local" export REVISIONS_SERVER_VERSION="local"
export REVISIONS_SERVER_NEW_RELIC_ENABLED=false
if [ -z "$REVISIONS_SERVER_SNS_TOPIC_ARN" ]; then if [ -z "$REVISIONS_SERVER_SNS_TOPIC_ARN" ]; then
export REVISIONS_SERVER_SNS_TOPIC_ARN="arn:aws:sns:us-east-1:000000000000:revisions-server-local-topic" export REVISIONS_SERVER_SNS_TOPIC_ARN="arn:aws:sns:us-east-1:000000000000:revisions-server-local-topic"
fi fi
@@ -374,10 +354,6 @@ fi
export API_GATEWAY_NODE_ENV=production export API_GATEWAY_NODE_ENV=production
export API_GATEWAY_VERSION=local export API_GATEWAY_VERSION=local
export API_GATEWAY_NEW_RELIC_ENABLED=false
export API_GATEWAY_NEW_RELIC_APP_NAME="API Gateway"
export API_GATEWAY_NEW_RELIC_NO_CONFIG_FILE=true
export API_GATEWAY_SYNCING_SERVER_JS_URL=http://localhost:$SYNCING_SERVER_PORT export API_GATEWAY_SYNCING_SERVER_JS_URL=http://localhost:$SYNCING_SERVER_PORT
export API_GATEWAY_AUTH_SERVER_URL=http://localhost:$AUTH_SERVER_PORT export API_GATEWAY_AUTH_SERVER_URL=http://localhost:$AUTH_SERVER_PORT
export API_GATEWAY_REVISIONS_SERVER_URL=http://localhost:$REVISIONS_SERVER_PORT export API_GATEWAY_REVISIONS_SERVER_URL=http://localhost:$REVISIONS_SERVER_PORT

View File

@@ -39,9 +39,5 @@
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.0.4" "typescript": "^5.0.4"
}, },
"packageManager": "yarn@4.0.0-rc.51", "packageManager": "yarn@4.0.0-rc.51"
"optionalDependencies": {
"@types/newrelic": "^9.14.0",
"newrelic": "^11.0.0"
}
} }

View File

@@ -19,14 +19,5 @@ SNS_AWS_REGION=
SQS_QUEUE_URL= SQS_QUEUE_URL=
SQS_AWS_REGION= SQS_AWS_REGION=
# (Optional) New Relic Setup
NEW_RELIC_ENABLED=false
NEW_RELIC_APP_NAME=Analytics
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info
# (Optional) Mixpanel # (Optional) Mixpanel
MIXPANEL_TOKEN= MIXPANEL_TOKEN=

View File

@@ -55,10 +55,5 @@
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"typeorm": "^0.3.17", "typeorm": "^0.3.17",
"winston": "^3.8.1" "winston": "^3.8.1"
},
"optionalDependencies": {
"@newrelic/winston-enricher": "^4.0.1",
"@types/newrelic": "^9.14.0",
"newrelic": "^11.0.0"
} }
} }

View File

@@ -78,13 +78,6 @@ export class ContainerConfigLoader {
container.bind(TYPES.Redis).toConstantValue(redis) container.bind(TYPES.Redis).toConstantValue(redis)
const winstonFormatters = [winston.format.splat(), winston.format.json()] const winstonFormatters = [winston.format.splat(), winston.format.json()]
if (env.get('NEW_RELIC_ENABLED', true) === 'true') {
await import('newrelic')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const newrelicFormatter = require('@newrelic/winston-enricher')
const newrelicWinstonFormatter = newrelicFormatter(winston)
winstonFormatters.push(newrelicWinstonFormatter())
}
const logger = winston.createLogger({ const logger = winston.createLogger({
level: env.get('LOG_LEVEL', true) || 'info', level: env.get('LOG_LEVEL', true) || 'info',
@@ -129,7 +122,6 @@ export class ContainerConfigLoader {
container.bind(TYPES.SNS_TOPIC_ARN).toConstantValue(env.get('SNS_TOPIC_ARN')) container.bind(TYPES.SNS_TOPIC_ARN).toConstantValue(env.get('SNS_TOPIC_ARN'))
container.bind(TYPES.SNS_AWS_REGION).toConstantValue(env.get('SNS_AWS_REGION', true)) container.bind(TYPES.SNS_AWS_REGION).toConstantValue(env.get('SNS_AWS_REGION', true))
container.bind(TYPES.SQS_QUEUE_URL).toConstantValue(env.get('SQS_QUEUE_URL')) container.bind(TYPES.SQS_QUEUE_URL).toConstantValue(env.get('SQS_QUEUE_URL'))
container.bind(TYPES.NEW_RELIC_ENABLED).toConstantValue(env.get('NEW_RELIC_ENABLED', true))
container.bind(TYPES.ADMIN_EMAILS).toConstantValue(env.get('ADMIN_EMAILS').split(',')) container.bind(TYPES.ADMIN_EMAILS).toConstantValue(env.get('ADMIN_EMAILS').split(','))
container.bind(TYPES.MIXPANEL_TOKEN).toConstantValue(env.get('MIXPANEL_TOKEN', true)) container.bind(TYPES.MIXPANEL_TOKEN).toConstantValue(env.get('MIXPANEL_TOKEN', true))

View File

@@ -9,7 +9,6 @@ const TYPES = {
SNS_AWS_REGION: Symbol.for('SNS_AWS_REGION'), SNS_AWS_REGION: Symbol.for('SNS_AWS_REGION'),
SQS_QUEUE_URL: Symbol.for('SQS_QUEUE_URL'), SQS_QUEUE_URL: Symbol.for('SQS_QUEUE_URL'),
SQS_AWS_REGION: Symbol.for('SQS_AWS_REGION'), SQS_AWS_REGION: Symbol.for('SQS_AWS_REGION'),
NEW_RELIC_ENABLED: Symbol.for('NEW_RELIC_ENABLED'),
ADMIN_EMAILS: Symbol.for('ADMIN_EMAILS'), ADMIN_EMAILS: Symbol.for('ADMIN_EMAILS'),
MIXPANEL_TOKEN: Symbol.for('MIXPANEL_TOKEN'), MIXPANEL_TOKEN: Symbol.for('MIXPANEL_TOKEN'),
// Repositories // Repositories

View File

@@ -17,15 +17,6 @@ HTTP_CALL_TIMEOUT=60000
AUTH_JWT_SECRET=auth_jwt_secret AUTH_JWT_SECRET=auth_jwt_secret
# (Optional) New Relic Setup
NEW_RELIC_ENABLED=false
NEW_RELIC_APP_NAME=API Gateway
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info
CACHE_TYPE=redis CACHE_TYPE=redis
REDIS_URL=redis://cache REDIS_URL=redis://cache

View File

@@ -61,10 +61,5 @@
"prettier": "^3.0.3", "prettier": "^3.0.3",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
"typescript": "^5.0.4" "typescript": "^5.0.4"
},
"optionalDependencies": {
"@newrelic/winston-enricher": "^4.0.1",
"@types/newrelic": "^9.14.0",
"newrelic": "^11.0.0"
} }
} }

View File

@@ -44,13 +44,6 @@ export class ContainerConfigLoader {
.toConstantValue(isConfiguredForHomeServerOrSelfHosting) .toConstantValue(isConfiguredForHomeServerOrSelfHosting)
const winstonFormatters = [winston.format.splat(), winston.format.json()] const winstonFormatters = [winston.format.splat(), winston.format.json()]
if (env.get('NEW_RELIC_ENABLED', true) === 'true') {
await import('newrelic')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const newrelicFormatter = require('@newrelic/winston-enricher')
const newrelicWinstonFormatter = newrelicFormatter(winston)
winstonFormatters.push(newrelicWinstonFormatter())
}
let logger: winston.Logger let logger: winston.Logger
if (configuration?.logger) { if (configuration?.logger) {

View File

@@ -45,15 +45,6 @@ SQS_AWS_REGION=
SYNCING_SERVER_URL=http://syncing-server-js:3000 SYNCING_SERVER_URL=http://syncing-server-js:3000
# (Optional) New Relic Setup
NEW_RELIC_ENABLED=false
NEW_RELIC_APP_NAME=Auth
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info
# (Optional) User Server # (Optional) User Server
USER_SERVER_REGISTRATION_URL= USER_SERVER_REGISTRATION_URL=
USER_SERVER_CHANGE_EMAIL_URL= USER_SERVER_CHANGE_EMAIL_URL=

Some files were not shown because too many files have changed in this diff Show More