コンテンツにスキップ

AWS Lambda 拡張機能


Version-1.34.0 · Experimental

AWS Lambda コレクターは AWS Lambda Extension を使用して AWS Lambda のメトリクスとログを収集します。

インストール

DataKit 1.x のインストール:この節の拡張機能のダウンロードリンクは、既定で DataKit 2.x/datakit-v2/ を使用します。DataKit 1.x では、URL 内の /datakit-v2//datakit/ に置き換えてください。静的リソースのドメインは、現在のドキュメントのブランドに応じて表示されます。

DataKit レイヤーの追加

  • ZIP からレイヤーを作成

    • ZIP のダウンロード先:

    • Lambda コンソールの レイヤーページを開きます。

    • Create layer(レイヤーの作成)を選択します。
    • Layer configurationName にレイヤー名を入力します。
    • Upload a .zip file を選び、Upload からローカルの ZIP ファイルを選択します。
    • Create(作成)を選択します。
  • ARN を使用してレイヤーを追加

    • Lambda コンソールの関数ページを開きます。
    • 設定する関数を選択します。
    • LayersAdd a layer を選択します。
    • Choose a layer でレイヤーのソースとして ARN を選択します。
    • テキストボックスに ARN を入力して Verify を選び、Add を選択します。

必要な環境変数の設定

  • ENV_DATAWAY=https://openway.guance.com?token=<your-token>

メトリクス

awslambda

AWS Lambda metrics produced from Lambda Telemetry API platform events. Duration and memory fields are per-event values, while error, timeout, out-of-memory, and invocation fields are event count increments when emitted.

Tags & Fields Description
aws_account_id
(tag)
AWS Account ID.
aws_lambda_function_memory_size
(tag)
Configured memory size for the Lambda function, in MB.
aws_lambda_function_name
(tag)
Lambda function name.
aws_lambda_function_version
(tag)
Lambda function version.
aws_lambda_initialization_type
(tag)
Initialization type of the Lambda function.
aws_region
(tag)
AWS region where the function is executed.
aws_runtime_version
(tag)
Lambda runtime version reported by Telemetry API init or restore start events when available.
aws_runtime_version_arn
(tag)
Lambda runtime version ARN reported by Telemetry API init or restore start events when available.
billed_duration_ms Billed duration for the invocation, in milliseconds, from the Telemetry API platform.report metrics.billedDurationMs field.
Type: int | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
duration_ms Invocation duration, in milliseconds, from the Telemetry API platform.report metrics.durationMs field.
Type: float | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
errors Count increment for invocations whose Telemetry API platform.runtimeDone status is not success.
Type: int | (count)
Unit: count
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
init_duration_ms Initialization phase duration, in milliseconds, from the Telemetry API platform.initReport metrics.durationMs field.
Type: float | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
invocations Count increment for Lambda invocations when emitted.
Type: int | (count)
Unit: count
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
max_memory_used_mb Maximum memory used by the invocation, in MB, from the Telemetry API platform.report metrics.maxMemoryUsedMB field.
Type: int | (gauge)
Unit: digital,MB
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
memory_size_mb Configured memory size for the Lambda function, in MB, from the Telemetry API platform.report metrics.memorySizeMB field.
Type: int | (gauge)
Unit: digital,MB
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
out_of_memory Count increment for Lambda out-of-memory failures when emitted.
Type: int | (count)
Unit: count
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
post_runtime_duration Time between runtime completion and the platform report, in milliseconds, calculated from platform.runtimeDone and platform.report durationMs values.
Type: float | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
produced_bytes Bytes produced by the invocation response, from the Telemetry API platform.runtimeDone metrics.producedBytes field when present.
Type: int | (gauge)
Unit: digital,B
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
response_duration_ms Response duration span, in milliseconds, when a Telemetry API span named responseDuration is emitted.
Type: float | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
response_latency Response latency span duration, in milliseconds, when a Telemetry API span named responseLatency is emitted.
Type: float | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
runtime_duration_ms Runtime phase duration for the invocation, in milliseconds, from the Telemetry API platform.runtimeDone metrics.durationMs field.
Type: float | (gauge)
Unit: time,ms
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn
timeouts Count increment for invocations whose Telemetry API platform.runtimeDone status is timeout.
Type: int | (count)
Unit: count
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_region, aws_runtime_version, aws_runtime_version_arn

ログ

awslambda

AWS Lambda log records forwarded from the Lambda Telemetry API.

Tags & Fields Description
aws_account_id
(tag)
AWS Account ID.
aws_lambda_function_memory_size
(tag)
Configured memory size for the Lambda function, in MB.
aws_lambda_function_name
(tag)
Lambda function name.
aws_lambda_function_version
(tag)
Lambda function version.
aws_lambda_initialization_type
(tag)
Initialization type of the Lambda function.
aws_log_from
(tag)
Log source type, currently function or extension.
aws_region
(tag)
AWS region where the function is executed.
aws_runtime_version
(tag)
Lambda runtime version reported by Telemetry API init or restore start events when available.
aws_runtime_version_arn
(tag)
Lambda runtime version ARN reported by Telemetry API init or restore start events when available.
message Log message.
Type: string
Unit: N/A
Tagged by: aws_account_id, aws_lambda_function_memory_size, aws_lambda_function_name, aws_lambda_function_version, aws_lambda_initialization_type, aws_log_from, aws_region, aws_runtime_version, aws_runtime_version_arn

対応コレクター

  • OpenTelemetry
  • statsd
  • ddtrace # 現在は golang のみ対応しています。Lambda 環境では ddtrace が特別な処理を行うため、tracer.WithLambdaMode(false) を追加してください。

フィードバック

このページは役に立ちましたか?