Skip to content

Commit

Permalink
feat: enable prometheus endpoint when the port is set (#1163)
Browse files Browse the repository at this point in the history
  • Loading branch information
3benbox authored Sep 13, 2023
1 parent afd6e20 commit 078f0b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"metrics": {
"collectorHost": "",
"exportIntervalMillis": 60000,
"exportTimeoutMillis": 30000
"exportTimeoutMillis": 30000,
"prometheusPort": 0
},
"db": {
"client": "postgresql",
Expand Down
3 changes: 2 additions & 1 deletion config/env/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"collectorHost": "@@COLLECTOR_HOSTNAME",
"traceRatio": "@@METRICS_TRACE_RATIO",
"exportIntervalMillis": "@@METRICS_EXPORT_INTERVAL_MS",
"exportTimeoutMillis": "@@METRICS_EXPORT_TIMEOUT_MS"
"exportTimeoutMillis": "@@METRICS_EXPORT_TIMEOUT_MS",
"prometheusPort": "@@METRICS_PROMETHEUS_PORT"
},
"db": {
"connection": {
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class CeramicAnchorApp {
DEFAULT_TRACE_SAMPLE_RATIO,
null, // no logging inside metrics
false, // do not append total to counters automatically
0, // do not turn on the prometheus exporter (use collector only)
this.config.metrics.prometheusPort, // turn on the prometheus exporter if port is set
this.config.metrics.exportIntervalMillis,
this.config.metrics.exportTimeoutMillis
)
Expand Down

0 comments on commit 078f0b2

Please sign in to comment.