diff --git a/content/en/docs/languages/js/instrumentation.md b/content/en/docs/languages/js/instrumentation.md index a7362827294b..ce15570ae37b 100644 --- a/content/en/docs/languages/js/instrumentation.md +++ b/content/en/docs/languages/js/instrumentation.md @@ -1261,10 +1261,9 @@ const metricReader = new PeriodicExportingMetricReader({ const myServiceMeterProvider = new MeterProvider({ resource: resource, + readers: [metricReader], }); -myServiceMeterProvider.addMetricReader(metricReader); - // Set this MeterProvider to be global to the app being instrumented. opentelemetry.metrics.setGlobalMeterProvider(myServiceMeterProvider); ``` @@ -1299,10 +1298,9 @@ const metricReader = new PeriodicExportingMetricReader({ const myServiceMeterProvider = new MeterProvider({ resource: resource, + readers: [metricReader], }); -myServiceMeterProvider.addMetricReader(metricReader); - // Set this MeterProvider to be global to the app being instrumented. opentelemetry.metrics.setGlobalMeterProvider(myServiceMeterProvider); ```