From 20f47b89be4def1b36ee27cef2db092458667b6e Mon Sep 17 00:00:00 2001 From: Rajat Khanna Date: Tue, 27 Feb 2024 16:29:12 +0530 Subject: [PATCH] Improve JS Instrumentation Docs (#4052) --- content/en/docs/languages/js/instrumentation.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); ```