docs(prom-example): remove deprecated startServer option (#2802)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
This commit is contained in:
parent
630a26182a
commit
144e11ab70
|
|
@ -3,16 +3,13 @@
|
||||||
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');
|
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');
|
||||||
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
|
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
|
||||||
|
|
||||||
const exporter = new PrometheusExporter(
|
const { endpoint, port } = PrometheusExporter.DEFAULT_OPTIONS;
|
||||||
{
|
|
||||||
startServer: true,
|
const exporter = new PrometheusExporter({}, () => {
|
||||||
},
|
|
||||||
() => {
|
|
||||||
console.log(
|
console.log(
|
||||||
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
|
`prometheus scrape endpoint: http://localhost:${port}${endpoint}`,
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
const meter = new MeterProvider({
|
const meter = new MeterProvider({
|
||||||
exporter,
|
exporter,
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,13 @@ const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
|
||||||
// Optional and only needed to see the internal diagnostic logging (during development)
|
// Optional and only needed to see the internal diagnostic logging (during development)
|
||||||
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
|
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
|
||||||
|
|
||||||
const exporter = new PrometheusExporter(
|
const { endpoint, port } = PrometheusExporter.DEFAULT_OPTIONS;
|
||||||
{
|
|
||||||
startServer: true,
|
const exporter = new PrometheusExporter({}, () => {
|
||||||
},
|
|
||||||
() => {
|
|
||||||
console.log(
|
console.log(
|
||||||
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
|
`prometheus scrape endpoint: http://localhost:${port}${endpoint}`,
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
const meter = new MeterProvider({
|
const meter = new MeterProvider({
|
||||||
exporter,
|
exporter,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue