-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(app-gen, worker): Add MetricsService #4928
Conversation
webSocketsQueueService = moduleRef.get<WebSocketsQueueService>(WebSocketsQueueService); | ||
workflowQueueService = moduleRef.get<WorkflowQueueService>(WorkflowQueueService); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't being used, it's overridden below.
nr.recordMetric(`Queue/${deploymentName}/${queueService.topic}/delayed`, delayedCount); | ||
nr.recordMetric(`Queue/${deploymentName}/${queueService.topic}/active`, activeCount); | ||
|
||
Logger.verbose(`Queue/${deploymentName}/${queueService.topic}`, { waitCount, delayedCount, activeCount }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verbose logging is handled in the metrics service now.
"@types/sinon": "^9.0.0", | ||
"codecov": "^3.5.0", | ||
"cpx": "^1.5.0", | ||
"dotenv": "^8.2.0", | ||
"chai": "^4.2.0", | ||
"jest": "^27.1.0", | ||
"newrelic": "^9", | ||
"npm-run-all": "^4.1.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding newrelic as devDependecies to keep the peer deps working as normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work!
describe('Azure', () => { | ||
it('should contain AzureMetricsService if METRICS_SERVICE is set to AZURE', async () => { | ||
process.env.METRICS_SERVICE = 'AZURE'; | ||
const metricsServices = await createServices(); | ||
|
||
expect( | ||
metricsServices.some( | ||
(metricsService) => metricsService instanceof AzureMetricsService | ||
) | ||
).toBe(true); | ||
delete process.env.METRICS_SERVICE; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing for the future!
What change does this PR introduce?
Why was this change needed?
By providing a capability to send metrics to any cloud monitoring tools, we can support self-hosted customers to use metrics tools of their choice and standardize metrics gathering on the Novu platform. Additionally, application-level metrics can be used as auto-scaling indicators.
Other information (Screenshots)
Startup logs info

Queue Metrics on Cloudwatch (verified locally with AWS Creds)

Queue Metrics on NewRelic (verified locally with NR Creds)
