Anna Claire Fields 0d64a88a46 Yarn 4 Migration (#32253) преди 3 месеца
..
test ad79c85cea [web] collect mongo stats on native client (#32909) преди 3 месеца
.mocharc.cjs fd0d21fbbd [monorepo] migrate build scripts to Jenkins (#29019) преди 10 месеца
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files преди 5 години
.nvmrc 1a7de4ddd8 Upgrades Node.js from 24.13.0 → 24.14.1 (#32498) преди 4 месеца
CHANGELOG.md a648015db8 Centralize prettier configuration to root level (#30501) преди 6 месеца
LICENSE 63520c7076 Merge pull request #16859 from overleaf/jpa-sharelatex-cleanup преди 2 години
README.md 5855ba7b49 Merge pull request #15241 from overleaf/em-gcp-opentelemetry преди 2 години
buildscript.txt 0d64a88a46 Yarn 4 Migration (#32253) преди 3 месеца
event_loop.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages преди 4 години
http.js 4ce5620b1d [web] add metrics for mongo access in split test system (#32920) преди 3 месеца
index.js 32ad596e54 [clsi] minor fixes for clsi-cache (#30551) преди 7 месеца
initialize.js 9a2847dbee [web] Add startup metrics (#25277) преди 1 година
leaked_sockets.js 7f48c67512 Add `prefer-node-protocol` ESLint rule (#21532) преди 1 година
memory.js ae444be728 Merge pull request #31913 from overleaf/dn0-remove-manual-gc преди 5 месеца
mongodb.js ad79c85cea [web] collect mongo stats on native client (#32909) преди 3 месеца
open_sockets.js 7f48c67512 Add `prefer-node-protocol` ESLint rule (#21532) преди 1 година
package.json 0d64a88a46 Yarn 4 Migration (#32253) преди 3 месеца
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) преди 6 месеца
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