Skip to content

Commit

Permalink
chore: template prometheus endpoint in examples rather than hardcode
Browse files Browse the repository at this point in the history
Signed-off-by: Naseem <[email protected]>
  • Loading branch information
Naseem committed Jun 4, 2020
1 parent dadcad7 commit 78131e1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion examples/metrics/metrics/observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const exporter = new PrometheusExporter(
startServer: true,
},
() => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
);
},
);

Expand Down
4 changes: 3 additions & 1 deletion examples/prometheus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const exporter = new PrometheusExporter(
startServer: true,
},
() => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
);
},
);

Expand Down
4 changes: 3 additions & 1 deletion getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ const exporter = new PrometheusExporter(
startServer: true,
},
() => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
);
},
);

Expand Down
4 changes: 3 additions & 1 deletion getting-started/monitored-example/monitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const exporter = new PrometheusExporter(
startServer: true,
},
() => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
);
},
);

Expand Down
4 changes: 3 additions & 1 deletion getting-started/ts-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ const exporter = new PrometheusExporter(
startServer: true,
},
() => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
);
},
);

Expand Down
4 changes: 3 additions & 1 deletion getting-started/ts-example/monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const exporter = new PrometheusExporter(
startServer: true,
},
() => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
);
},
);

Expand Down

0 comments on commit 78131e1

Please sign in to comment.