|
@@ -3,10 +3,8 @@ import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-ho
|
|
|
import { resourceFromAttributes } from '@opentelemetry/resources';
|
|
import { resourceFromAttributes } from '@opentelemetry/resources';
|
|
|
import { NodeSDKConfiguration } from '@opentelemetry/sdk-node';
|
|
import { NodeSDKConfiguration } from '@opentelemetry/sdk-node';
|
|
|
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
|
-import { VENDURE_VERSION } from '@vendure/core';
|
|
|
|
|
|
|
|
|
|
export function getSdkConfiguration(
|
|
export function getSdkConfiguration(
|
|
|
- instrumentationEnabled: boolean = true,
|
|
|
|
|
devMode: boolean = false,
|
|
devMode: boolean = false,
|
|
|
config: Partial<NodeSDKConfiguration> = {},
|
|
config: Partial<NodeSDKConfiguration> = {},
|
|
|
): Partial<NodeSDKConfiguration> {
|
|
): Partial<NodeSDKConfiguration> {
|
|
@@ -23,13 +21,12 @@ export function getSdkConfiguration(
|
|
|
return {
|
|
return {
|
|
|
resource: resourceFromAttributes({
|
|
resource: resourceFromAttributes({
|
|
|
'service.name': 'vendure',
|
|
'service.name': 'vendure',
|
|
|
- 'service.version': VENDURE_VERSION,
|
|
|
|
|
'service.namespace': 'vendure',
|
|
'service.namespace': 'vendure',
|
|
|
'service.environment': process.env.NODE_ENV || 'development',
|
|
'service.environment': process.env.NODE_ENV || 'development',
|
|
|
}),
|
|
}),
|
|
|
...devModeAwareConfig,
|
|
...devModeAwareConfig,
|
|
|
contextManager: new AsyncLocalStorageContextManager(),
|
|
contextManager: new AsyncLocalStorageContextManager(),
|
|
|
- instrumentations: instrumentationEnabled ? [getNodeAutoInstrumentations()] : [],
|
|
|
|
|
|
|
+ instrumentations: [getNodeAutoInstrumentations()],
|
|
|
...rest,
|
|
...rest,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|