내용으로 건너뛰기

ADOT Collector + Node.js + X-Ray: What is the default sampling behavior?

0

Hi AWS team,

I am currently instrumenting my application using the following setup:

When using OpenTelemetry JavaScript SDK + ADOT Collector + X-Ray exporter without explicitly configuring OTEL_TRACES_SAMPLER, is the following understanding correct?

  • The default OpenTelemetry JavaScript sampler is used
  • Therefore, Node.js ends up effectively doing 100% sampling (all spans recorded and sent)
    • X-Ray default sampling Reservoir: 0, Rate: 5 is not applied.

질문됨 일 년 전291회 조회

1개 답변
0
수락된 답변

When using OpenTelemetry JavaScript SDK with ADOT Collector and X-Ray exporter without explicitly configuring OTEL_TRACES_SAMPLER, the default sampling behavior depends on your specific setup.

For Application Signals with X-Ray, by default, X-Ray centralized sampling is enabled with the following settings:

  • Reservoir rate: 1 trace per second
  • Fixed rate: 5%

The environment variables for the ADOT SDK agent are automatically set as:

However, if you're using ADOT auto-instrumentation for Node.js without explicitly setting these environment variables, the behavior is different. The ADOT auto-instrumentation for Node.js supports X-Ray remote sampling, but you need to explicitly enable it by setting the environment variable OTEL_TRACES_SAMPLER=xray.

If you don't set this environment variable, the default OpenTelemetry JavaScript sampler will be used, which typically samples at 100% (all spans recorded and sent). In this case, the X-Ray default sampling rules (Reservoir: 1/s, Rate: 5%) would not be applied.

To ensure your Node.js application uses X-Ray sampling rules, you should explicitly set OTEL_TRACES_SAMPLER=xray in your environment variables.
Sources
Trace sampling rate - Amazon CloudWatch
Migrate to OpenTelemetry Node.js - AWS X-Ray

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.