update documentation to register metrics once

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2025-04-25 13:00:45 +02:00
parent 0800aa5713
commit 4f63426a59
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -14,6 +14,11 @@
* limitations under the License.
*/
// Prevent from running more than once (due to worker threads)
if (!require('node:worker_threads').isMainThread) {
return;
}
const { NodeSDK } = require('@opentelemetry/sdk-node');
const {
getNodeAutoInstrumentations,