スキップしてコンテンツを表示

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.

質問済み 1年前298ビュー

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

回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ