sasai-common-utils 1.0.40 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -10,24 +10,28 @@ try {
|
|
|
10
10
|
const { OTLPLogExporter } = require("@opentelemetry/exporter-logs-otlp-http");
|
|
11
11
|
const { resourceFromAttributes } = require("@opentelemetry/resources");
|
|
12
12
|
|
|
13
|
-
// Create OTLP Log Exporter
|
|
13
|
+
// Create OTLP Log Exporter with collector options
|
|
14
14
|
const logExporter = new OTLPLogExporter({
|
|
15
|
-
url: globalConfig.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT || 'http://localhost:4318/v1/logs'
|
|
15
|
+
url: globalConfig.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT || 'http://localhost:4318/v1/logs',
|
|
16
|
+
concurrencyLimit: 1 // Limit on pending requests
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
// Create batch processor for efficient log export
|
|
19
20
|
const logRecordProcessor = new BatchLogRecordProcessor(logExporter);
|
|
20
21
|
|
|
21
|
-
// Create Logger Provider with resource attributes and
|
|
22
|
+
// Create Logger Provider with resource attributes and processors
|
|
22
23
|
otelLoggerProvider = new LoggerProvider({
|
|
23
24
|
resource: resourceFromAttributes({
|
|
24
25
|
'service.name': globalConfig.SERVICE_NAME || 'sasai-service',
|
|
25
26
|
'deployment.environment': globalConfig.NODE_ENV || ''
|
|
26
27
|
}),
|
|
27
|
-
|
|
28
|
+
processors: [logRecordProcessor] // Use 'processors' not 'logRecordProcessors'
|
|
28
29
|
});
|
|
29
30
|
|
|
30
|
-
console.log('✅ OpenTelemetry Logs SDK initialized'
|
|
31
|
+
console.log('✅ OpenTelemetry Logs SDK initialized', {
|
|
32
|
+
endpoint: globalConfig.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT || 'http://localhost:4318/v1/logs',
|
|
33
|
+
serviceName: globalConfig.SERVICE_NAME
|
|
34
|
+
});
|
|
31
35
|
} catch (error) {
|
|
32
36
|
console.warn('⚠️ OpenTelemetry Logs SDK not available, logs will only write locally:', error.message);
|
|
33
37
|
}
|