Mathias Jakobsen 50b346b4ed Merge pull request #10279 from overleaf/jpa-tracing-optimizations há 3 anos atrás
..
.circleci 2f35db4087 Fix startup crash há 5 anos atrás
test e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs há 4 anos atrás
.dockerignore 8945373715 Merge pull request #5724 from overleaf/jpa-lean-docker-build há 4 anos atrás
.gitignore 23efa1d977 [misc] prepare for monorepo há 5 anos atrás
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files há 5 anos atrás
.nvmrc 51806703b7 Merge pull request #9819 from overleaf/bg-node-upgrade há 3 anos atrás
CHANGELOG.md c94043e2fe Merge pull request #10144 from overleaf/ii-metrics-api-patch-opts-arg há 3 anos atrás
LICENSE 60857982b6 Create LICENSE há 12 anos atrás
README.md d9d65ac31c Merge pull request #5246 from overleaf/bg-upgrade-logger-in-all-libraries há 4 anos atrás
buildscript.txt 51806703b7 Merge pull request #9819 from overleaf/bg-node-upgrade há 3 anos atrás
event_loop.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages há 4 anos atrás
http.js efcb06f0df Merge pull request #7905 from overleaf/em-request-logging há 4 anos atrás
index.js 3d9c8f80f4 Merge pull request #10227 from overleaf/spd-td-opentelementry há 3 anos atrás
memory.js e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs há 4 anos atrás
mongodb.js e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs há 4 anos atrás
open_sockets.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages há 4 anos atrás
package.json 3d9c8f80f4 Merge pull request #10227 from overleaf/spd-td-opentelementry há 3 anos atrás
prom_wrapper.js 264b107e39 Merge pull request #6927 from overleaf/jpa-split-clsi-metrics há 4 anos atrás
timeAsyncMethod.js e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs há 4 anos atrás
tracing.js 50b346b4ed Merge pull request #10279 from overleaf/jpa-tracing-optimizations há 3 anos atrás
uv_threadpool_size.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages há 4 anos atrás

README.md

overleaf/metrics-module

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

Use:

const metrics = require('@overleaf/metrics')
metrics.initialize('myapp')

const express = require('express')
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.
  • ENABLE_TRACE_AGENT - enables @google-cloud/trace-agent on Google Cloud
  • ENABLE_DEBUG_AGENT - enables @google-cloud/debug-agent on Google Cloud
  • ENABLE_PROFILE_AGENT - enables @google-cloud/profiler on Google Cloud
  • 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