Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/instrumentation.mts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// This file handles the tracing initialization and starts the tracing process before the app starts.
// You should be careful about editing this file, as it is a critical part of the application's functionality.
// Because this file is a module it should imported using the `--import` flag in the `node` command, and should not be imported by any other file.
import { isMainThread } from 'node:worker_threads';
import { tracingFactory } from './common/tracing.js';
import { getConfig, initConfig } from './common/config.js';

await initConfig();
if (isMainThread) {
await initConfig();

const config = getConfig();
const config = getConfig();

const tracingConfig = config.get('telemetry.tracing');
const sharedConfig = config.get('telemetry.shared');
const tracingConfig = config.get('telemetry.tracing');
const sharedConfig = config.get('telemetry.shared');

const tracing = tracingFactory({ ...tracingConfig, ...sharedConfig });
const tracing = tracingFactory({ ...tracingConfig, ...sharedConfig });

tracing.start();
tracing.start();
}
Loading