Skip to content

[Genesis] Configure logs pipeline #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import { AwsXRayRemoteSampler } from './sampler/aws-xray-remote-sampler';
import { LIB_VERSION } from './version';
import { OTLPAwsLogExporter } from './exporter/otlp/aws/logs/otlp-aws-log-exporter';
import { AwsBatchLogRecordProcessor } from './exporter/otlp/aws/logs/aws-batch-log-record-processor';
import { isAgentObservabilityEnabled } from './utils';

const AWS_TRACES_OTLP_ENDPOINT_PATTERN = '^https://xray\\.([a-z0-9-]+)\\.amazonaws\\.com/v1/traces$';
const AWS_LOGS_OTLP_ENDPOINT_PATTERN = '^https://logs\\.([a-z0-9-]+)\\.amazonaws\\.com/v1/logs$';
Expand Down Expand Up @@ -148,7 +149,7 @@ export class AwsOpentelemetryConfigurator {
defaultDetectors = getResourceDetectorsFromEnv();
// Add Env/AWS Resource Detectors if not present
const resourceDetectorsFromEnv: string[] = process.env.OTEL_NODE_RESOURCE_DETECTORS.split(',');
if (!resourceDetectorsFromEnv.includes('aws')) {
if (!resourceDetectorsFromEnv.includes('aws') && !isAgentObservabilityEnabled()) {
defaultDetectors.push(awsEc2DetectorSync, awsEcsDetectorSync, awsEksDetectorSync);
}
if (!resourceDetectorsFromEnv.includes('env')) {
Expand Down Expand Up @@ -432,7 +433,7 @@ export class AwsLoggerProcessorProvider {
if (exporter instanceof ConsoleLogRecordExporter) {
return new SimpleLogRecordProcessor(exporter);
}
if (exporter instanceof OTLPAwsLogExporter) {
if (exporter instanceof OTLPAwsLogExporter && isAgentObservabilityEnabled()) {
return new AwsBatchLogRecordProcessor(exporter);
}

Expand Down
Loading