Skip to content

Commit b0f1e10

Browse files
committed
add logs processor
1 parent 74366fc commit b0f1e10

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ export class ApplicationSignalsExporterProvider {
402402
}
403403

404404
export class AwsLoggerProcessorProvider {
405+
405406
private _logRecordProcessors: LogRecordProcessor[] = [];
406407

407408
constructor() {
@@ -413,7 +414,7 @@ export class AwsLoggerProcessorProvider {
413414
}
414415

415416
private configureLoggerProviderFromEnv(): void {
416-
const otlpExporterLogsEndpoint = process.env['OTEL_EXPORTER_OTLP_TRACES_ENDPOINT'];
417+
const otlpExporterLogsEndpoint = process.env['OTEL_EXPORTER_OTLP_LOGS_ENDPOINT'];
417418
const enabledExporters = AwsLoggerProcessorProvider.getStringListFromEnv('OTEL_LOGS_EXPORTER') ?? [];
418419

419420
if (enabledExporters.length === 0) {

aws-distro-opentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/common/aws-authenticator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class AwsAuthenticator {
4444

4545
const cleanedHeaders = this.removeSigV4Headers(headers);
4646

47-
const request = new HttpRequest.httpRequest({
47+
const request = new HttpRequest({
4848
method: 'POST',
4949
protocol: 'https',
5050
hostname: url.hostname,

aws-distro-opentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/logs/otlp-aws-log-exporter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class OTLPAwsLogExporter extends OTLPProtoLogExporter {
2525
super(changeUrlConfig(endpoint, config));
2626
this.region = endpoint.split('.')[1];
2727
this.endpoint = endpoint;
28-
this.authenticator = new AwsAuthenticator(this.region, 'xray');
28+
this.authenticator = new AwsAuthenticator(this.region, 'logs');
2929
}
3030

3131
/**
@@ -37,6 +37,7 @@ export class OTLPAwsLogExporter extends OTLPProtoLogExporter {
3737
items: ReadableLogRecord[],
3838
resultCallback: (result: ExportResult) => void
3939
): Promise<void> {
40+
4041
const serializedLogs: Uint8Array | undefined = ProtobufLogsSerializer.serializeRequest(items);
4142
const headers = this['_delegate']._transport?._transport?._parameters?.headers();
4243

0 commit comments

Comments
 (0)