-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to serve Prometheus metrics #671 #693
Add option to serve Prometheus metrics #671 #693
Conversation
sandbox/run.sh
Outdated
NODE_PATH=_build:_build/stubs:_build/ext node _build/stubs/app/server/server.js | ||
if [[ -n "$GRIST_PROMCLIENT_PORT" ]]; then | ||
require_promclient="--require ./_build/stubs/app/server/prometheus-exporter.js" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the prom-client
dependency is embedded no matter what, do you think we keep that --require
option as is or may we just import prometheus-exporter.ts
as a regular TS module in stubs/app/server/server.ts
and conditionally run server.listen
or not there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's keep it simple, include the dependency unconditionally, and use a regular TS module. Thanks @fflorent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! That's done here: a7a14e3
sandbox/run.sh
Outdated
NODE_PATH=_build:_build/stubs:_build/ext node _build/stubs/app/server/server.js | ||
if [[ -n "$GRIST_PROMCLIENT_PORT" ]]; then | ||
require_promclient="--require ./_build/stubs/app/server/prometheus-exporter.js" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's keep it simple, include the dependency unconditionally, and use a regular TS module. Thanks @fflorent
sandbox/watch.sh
Outdated
require_promclient="--require ./_build/stubs/app/server/prometheus-exporter.js" | ||
fi | ||
|
||
ls _build/stubs/app/server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this ls
debugging code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, sorry, I remove that!
a7a14e3
to
b30b154
Compare
b30b154
to
f46ce54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fflorent !
Context
At the ANCT, we faced a Ouf Of Memory crash of Grist. The problem was somehow solved but we'd like to monitor Grist a bit more, beyond logs.
That's the reason of this PR: proposing a Prometheus exporter.
Technical aspects
--require
option to load the prometheus-exporter.ts moduleResolves #671