Skip to content

Commit

Permalink
ref: Add Sentry metrics to Chartcuterie
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jan 2, 2024
1 parent c1436de commit cc6f326
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 469 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"README"
],
"dependencies": {
"@sentry/node": "7.49.0",
"@sentry/profiling-node": "1.0.0-alpha.5",
"@sentry/node": "7.91.0",
"@sentry/profiling-node": "1.3.2",
"canvas": "^2.11.2",
"dotenv": "^8.2.0",
"echarts": "5.4.0",
Expand Down
6 changes: 6 additions & 0 deletions src/renderServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export function renderServer(config: ConfigService) {
],
profilesSampleRate: 1,
tracesSampleRate: 1,
_experiments: {
metricsAggregator: true,
},
});

renderRoutes.use(express.json({limit: '20mb'}));
Expand Down Expand Up @@ -84,6 +87,9 @@ export function renderServer(config: ConfigService) {
status: resp.statusCode,
time,
});

Sentry.metrics.increment('render.count');
Sentry.metrics.distribution('render.time', time);
});
renderRoutes.use(Sentry.Handlers.errorHandler());

Expand Down
Loading

0 comments on commit cc6f326

Please sign in to comment.