update(opentelemetry): Upgrade OTel dependencies (#6540)

Co-authored-by: Shnatu <snatu@google.com>
This commit is contained in:
Shardul Natu
2025-08-19 16:39:59 -07:00
committed by GitHub
parent a01d411c5a
commit faff1c2ec7
3 changed files with 292 additions and 271 deletions

View File

@@ -14,7 +14,7 @@ import { OTLPMetricExporter as OTLPMetricExporterHttp } from '@opentelemetry/exp
import { CompressionAlgorithm } from '@opentelemetry/otlp-exporter-base';
import { NodeSDK } from '@opentelemetry/sdk-node';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { Resource } from '@opentelemetry/resources';
import { resourceFromAttributes } from '@opentelemetry/resources';
import {
BatchSpanProcessor,
ConsoleSpanExporter,
@@ -78,7 +78,7 @@ export function initializeTelemetry(config: Config): void {
return;
}
const resource = new Resource({
const resource = resourceFromAttributes({
[SemanticResourceAttributes.SERVICE_NAME]: SERVICE_NAME,
[SemanticResourceAttributes.SERVICE_VERSION]: process.version,
'session.id': config.getSessionId(),
@@ -153,7 +153,7 @@ export function initializeTelemetry(config: Config): void {
sdk = new NodeSDK({
resource,
spanProcessors: [new BatchSpanProcessor(spanExporter)],
logRecordProcessor: new BatchLogRecordProcessor(logExporter),
logRecordProcessors: [new BatchLogRecordProcessor(logExporter)],
metricReader,
instrumentations: [new HttpInstrumentation()],
});