Jakob Ackermann fd647002f5 [monorepo] enable caching for eslint and prettier (#30967) 6 meses atrás
..
test 425e7b1e5b [web] enable mongo notablescan in CI (#29501) 7 meses atrás
.mocharc.cjs fd0d21fbbd [monorepo] migrate build scripts to Jenkins (#29019) 10 meses atrás
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files 5 anos atrás
.nvmrc e80ce42896 Upgrade Node.js from 22.18 to 24.13 (#30509) 6 meses atrás
CHANGELOG.md a648015db8 Centralize prettier configuration to root level (#30501) 6 meses atrás
LICENSE 63520c7076 Merge pull request #16859 from overleaf/jpa-sharelatex-cleanup 2 anos atrás
README.md 5855ba7b49 Merge pull request #15241 from overleaf/em-gcp-opentelemetry 2 anos atrás
buildscript.txt e80ce42896 Upgrade Node.js from 22.18 to 24.13 (#30509) 6 meses atrás
event_loop.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages 4 anos atrás
http.js 7aa66b260c Merge pull request #28541 from overleaf/td-notifications-app-ts 10 meses atrás
index.js 32ad596e54 [clsi] minor fixes for clsi-cache (#30551) 7 meses atrás
initialize.js 9a2847dbee [web] Add startup metrics (#25277) 1 ano atrás
leaked_sockets.js 7f48c67512 Add `prefer-node-protocol` ESLint rule (#21532) 1 ano atrás
memory.js e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs 4 anos atrás
mongodb.js 56f70b3246 Support v5 of mongodb when recording metrics 2 anos atrás
open_sockets.js 7f48c67512 Add `prefer-node-protocol` ESLint rule (#21532) 1 ano atrás
package.json fd647002f5 [monorepo] enable caching for eslint and prettier (#30967) 6 meses atrás
prom_wrapper.js 5683cebf71 Merge pull request #11679 from overleaf/em-upgrade-prom-client 3 anos atrás
tsconfig.json a648015db8 Centralize prettier configuration to root level (#30501) 6 meses atrás
uv_threadpool_size.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages 4 anos atrás

README.md

overleaf/metrics-module

Wrappers the prom-client npm module to provide Prometheus metrics at /metrics.

Use:

// Metrics must be initialized before importing anything else
require('@overleaf/metrics/initialize')

const express = require('express')
const metrics = require('@overleaf/metrics')
const app = express()
metrics.injectMetricsRoute(app)

Request logging can be enabled:

const logger = require('@overleaf/logger')
...
app.use(metrics.http.monitor(logger))

The metrics module can be configured through the following environment variables:

  • DEBUG_METRICS - enables display of debugging messages to the console.
  • GCP_OPENTELEMETRY - enables OpenTelemetry tracing for GCP
  • JAEGER_OPENTELEMETRY - enables OpenTelemetry tracing for Jaeger (in the dev environment)
  • METRICS_APP_NAME - the app label for metrics and spans
  • METRICS_COMPRESSION_LEVEL - sets the compression level for /metrics
  • STACKDRIVER_LOGGING - toggles the request logging format
  • UV_THREADPOOL_SIZE - sets the libuv thread pool size