Skip to content

Commit 54fc26c

Browse files
authored
Merge branch 'master' into metric-kind
2 parents 8c0679e + 121b03d commit 54fc26c

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

examples/metrics/metrics/observer.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const exporter = new PrometheusExporter(
88
startServer: true,
99
},
1010
() => {
11-
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
11+
console.log(
12+
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
13+
);
1214
},
1315
);
1416

examples/prometheus/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const exporter = new PrometheusExporter(
88
startServer: true,
99
},
1010
() => {
11-
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
11+
console.log(
12+
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
13+
);
1214
},
1315
);
1416

getting-started/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,17 @@ Next, modify your `monitoring.js` file to look like this:
303303
const { MeterProvider } = require('@opentelemetry/metrics');
304304
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
305305
306+
const prometheusPort = PrometheusExporter.DEFAULT_OPTIONS.port
307+
const prometheusEndpoint = PrometheusExporter.DEFAULT_OPTIONS.endpoint
308+
306309
const exporter = new PrometheusExporter(
307310
{
308311
startServer: true,
309312
},
310313
() => {
311-
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
314+
console.log(
315+
`prometheus scrape endpoint: http://localhost:${prometheusPort}${Prometheusendpoint}`,
316+
);
312317
},
313318
);
314319

getting-started/monitored-example/monitoring.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const exporter = new PrometheusExporter(
88
startServer: true,
99
},
1010
() => {
11-
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
11+
console.log(
12+
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
13+
);
1214
},
1315
);
1416

getting-started/ts-example/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,17 @@ import { MeterProvider } from '@opentelemetry/metrics';
301301
import { Metric, BoundCounter } from '@opentelemetry/api';
302302
import { PrometheusExporter } from '@opentelemetry/exporter-prometheus';
303303
304+
const prometheusPort = PrometheusExporter.DEFAULT_OPTIONS.port
305+
const prometheusEndpoint = PrometheusExporter.DEFAULT_OPTIONS.endpoint
306+
304307
const exporter = new PrometheusExporter(
305308
{
306309
startServer: true,
307310
},
308311
() => {
309-
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
312+
console.log(
313+
`prometheus scrape endpoint: http://localhost:${prometheusPort}${Prometheusendpoint}`,
314+
);
310315
},
311316
);
312317

getting-started/ts-example/monitoring.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ const exporter = new PrometheusExporter(
77
startServer: true,
88
},
99
() => {
10-
console.log('prometheus scrape endpoint: http://localhost:9464/metrics');
10+
console.log(
11+
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
12+
);
1113
},
1214
);
1315

0 commit comments

Comments
 (0)