fix circular references

This commit is contained in:
Nour Alharithi
2023-12-14 16:04:24 -08:00
parent f506950dd6
commit 1760d6f0c4
3 changed files with 36 additions and 20 deletions

View File

@@ -39,6 +39,7 @@ import {
accountUpdatesCounter,
cacheHitCounter,
setLastReceivedWsMsgTs,
runtimeSpecsGauge,
} from './core/metrics';
import { handleResponseTime } from './core/middleware';
import {
@@ -125,6 +126,17 @@ app.use((req, _res, next) => {
next();
});
// Metrics defined here
const bootTimeMs = Date.now();
runtimeSpecsGauge.addCallback((obs) => {
obs.observe(bootTimeMs, {
commit: commitHash,
driftEnv,
rpcEndpoint: endpoint,
wsEndpoint: wsEndpoint,
});
});
app.use(errorHandler);
const server = http.createServer(app);