Convert the streaming server to ESM (#29389)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
bc4c5ed918
commit
036f5a05e3
8 changed files with 65 additions and 78 deletions
|
@ -1,6 +1,6 @@
|
|||
// @ts-check
|
||||
|
||||
const metrics = require('prom-client');
|
||||
import metrics from 'prom-client';
|
||||
|
||||
/**
|
||||
* @typedef StreamingMetrics
|
||||
|
@ -18,7 +18,7 @@ const metrics = require('prom-client');
|
|||
* @param {import('pg').Pool} pgPool
|
||||
* @returns {StreamingMetrics}
|
||||
*/
|
||||
function setupMetrics(channels, pgPool) {
|
||||
export function setupMetrics(channels, pgPool) {
|
||||
// Collect metrics from Node.js
|
||||
metrics.collectDefaultMetrics();
|
||||
|
||||
|
@ -101,5 +101,3 @@ function setupMetrics(channels, pgPool) {
|
|||
messagesSent,
|
||||
};
|
||||
}
|
||||
|
||||
exports.setupMetrics = setupMetrics;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue