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

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