Coldstart Processor creating broken traces for cold start and next invocation

オープン
#2,099 コメント 2 件 リアクション 5 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
aws, nodejs

調査の方向性

まず、示されている collector.yaml の coldstart 設定を使用して、0.19.0 の Node.js レイヤーと collector レイヤーで 4 リクエストのシナリオを再現します。最初の invocation の init span を含め、生成されたトレースと collector の出力を比較します。4 つの異なる完全なトレースが到着し、coldstart のトレースに期待される初期化データが含まれていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug processor/cold_start

Describe the bug
I was unable to get the coldstart processor to do what is says that it does on the tin. If i submit 4 requests to a helloworld function behind an api gateway I only end up with 3 traces in my observability platform. Two of these traces will use the same internal spans, have missing spans and appears to be related to the cold start. One trace goes missing. Invocations from coldstart + 3 appear normal.

Steps to reproduce

  • Create a hello world Lambda function fronted by either a REST or HTTP api in AWS
  • Deploy the api and function with the otel collector and nodejs layers bundled with a custom collector.yaml that enables the coldstart processor. ie.
processors:
  coldstart:
  resource:
    attributes:
      - key: deployment.environment.name
        value: '${env:ENVIRONMENT_NAME}'
        action: upsert

Additional configure the collector.yaml to send to your observability platform of choice.
I had the following env variables set for the function:

      // OpenTelemetry configuration
      AWS_LAMBDA_EXEC_WRAPPER: '/opt/otel-handler',
      OPENTELEMETRY_COLLECTOR_CONFIG_URI: '/var/task/collector.yaml',
      OTEL_TRACES_SAMPLER: 'always_on',
      OTEL_PROPAGATORS: 'tracecontext,baggage',
      OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION: 'true',
      OTEL_NODE_ENABLED_INSTRUMENTATIONS: 'aws-sdk,aws-lambda,http,undici',
      OTEL_SERVICE_NAME: serviceName,
      OPENTELEMETRY_EXTENSION_LOG_LEVEL: 'INFO',

I tried active tracing on, passthrough and off.
I tried the insights layer on and off.

  • Manually trigger a http get request to the api/function endpoint four times
  • Check traces that arrive in the observability platform

What did you expect to see?
I expected to see 4 traces arrive in my observability platform (grafana cloud). I expected the first trace that would have triggered a cold start to have a trace that includes a span for the init phase and be of a longer duration than the other three.

What did you see instead?

  • Only three traces arrived.
Image
  • One trace went missing

  • The first two traces are broken

    • trace 1
    Image
    • trace 2
    Image
    • trace 3
    Image

What version of collector/language SDK version did you use?

  • 0.19.0 (collector layer)
  • 0.19.0 (nodejs layer)

What language layer did you use?
nodejs

Additional context
I tried a few different things to try and get this to work:

  • bundling to commonjs and esm
  • using a http or rest api gateway
  • removing the batch and decouple processors
  • putting the coldstart processor first/last in order of execution
  • setting the function active tracing to on, passthrough and off.
  • removing the insight lambda layer

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

主要言語
Go
スター
433
フォーク
249
平均マージ
1日 12時間
マージ済み PR(30日)
39

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-telemetry/opentelemetry-lambda のほかの issue

open-telemetry/opentelemetry-lambda の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。