1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00
unleash.unleash/src/lib/metric-events.ts
Fredrik Strand Oseberg fe4bb4f227
feat: scheduled functions observability (#5377)
See linear issue:
https://linear.app/unleash/issue/1-1656/add-scheduler-observability

As per post mortem actions, we are adding observability to scheduled
functions.

This PR adds prometheus observability to our scheduled functions via a
summary. In addition to timing these functions with the more accurate
process.hrtime, we are getting a counter for free per scheduled job id.

Prometheus example: 

<img width="731" alt="Skjermbilde 2023-11-21 kl 13 36 33"
src="https://github.com/Unleash/unleash/assets/16081982/08a2064d-5152-4b4f-8a08-eb06e726757a">
2023-11-21 13:42:38 +01:00

6 lines
168 B
TypeScript

const REQUEST_TIME = 'request_time';
const DB_TIME = 'db_time';
const SCHEDULER_JOB_TIME = 'scheduler_job_time';
export { REQUEST_TIME, DB_TIME, SCHEDULER_JOB_TIME };