Begin prometheus integration
Add a dependency on `prom-client` and emit a basic latency metric for testing purposes. Add a new configuration file for enabling/disabling prometheus exporter and configuring the listen address.
This commit is contained in:
parent
dd770137e5
commit
c7bec6251e
10 changed files with 222 additions and 1 deletions
23
src/configuration/prometheusconfig.js
Normal file
23
src/configuration/prometheusconfig.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class PrometheusConfig {
|
||||
constructor(config = { prometheus: { enabled: false } }) {
|
||||
this.config = config.prometheus;
|
||||
}
|
||||
|
||||
isEnabled() {
|
||||
return this.config.enabled;
|
||||
}
|
||||
|
||||
getPort() {
|
||||
return this.config.port;
|
||||
}
|
||||
|
||||
getHost() {
|
||||
return this.config.host;
|
||||
}
|
||||
|
||||
getPath() {
|
||||
return this.config.path;
|
||||
}
|
||||
}
|
||||
|
||||
export { PrometheusConfig };
|
||||
Loading…
Add table
Add a link
Reference in a new issue