update documentation to register metrics once
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -27,6 +27,11 @@ yarn --cwd packages/backend add \
|
||||
In your `packages/backend/src` folder, create an `instrumentation.js` file.
|
||||
|
||||
```typescript title="in packages/backend/src/instrumentation.js"
|
||||
// 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,
|
||||
|
||||
Reference in New Issue
Block a user