Slide 1

Slide 1 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. 信頼性を⽀える テレメトリーパイプラインの構築 システム構成に応じた選択と実装の考慮点 ⼭⼝ 能迪 @ymotongpoo S R E K A I G I 2 0 2 5 アマゾンウェブサービスジャパン合同会社 シニアデベロッパーアドボケイト

Slide 2

Slide 2 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. ⾃⼰紹介 ⼭⼝ 能迪(やまぐち よしふみ) 専⾨領域 • オブザーバビリティ • SRE全般 翻訳 • 『⼊⾨OpenTelemetry』『SREをはじめよう』他多数 2 @ymotongpoo 2025年1⽉23⽇発売

Slide 3

Slide 3 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. 1. OpenTelemetryを⽤いたテレメトリーパイプラインの主要素 2. OpenTelemetryを⽤いたテレメトリーパイプラインの主要パターン 3. 各パターンにおける検討事項 4. OpenTelemetryの今後の展望 3 ⽬次

Slide 4

Slide 4 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. SRE におけるオブザーバビリティの重要性 4 『SREをはじめよう』 14章より

Slide 5

Slide 5 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpenTelemetry is a collection of APIs, SDKs, and tools. Use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior. OpenTelemetry official page https://opentelemetry.io/ 5

Slide 6

Slide 6 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpenTelemetry の 主要構成要素 6

Slide 7

Slide 7 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. テレメトリーパイプラインの構成要素 7 サービス SDK コレクター インフラ OTLP API コレクター バックエンド

Slide 8

Slide 8 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpenTelemetry API/SDK の役割 8 サービス API SDK ビジネスロジック ミドルウェア 各種クライアント API • 計装の本体は API のみを⽤いる • デフォルトでは no-op SDK • テレメトリー収集と送信の本体

Slide 9

Slide 9 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. レシーバー テレメトリーの受信と内部データへの変換 プロセッサー 内部データへの追加処理 エクスポーター 外部へのテレメトリーの送信(転送) コネクター ⾃分へデータをルーティング OpenTelemetry コレクターの役割 9 c.f. AWS Distro for CloudWatch コレクター

Slide 10

Slide 10 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. バックエンドシステムとの連携 10 • コレクター • SDK OTLP 独⾃プロトコル OTLP OpenTelemetry が策定したテレメトリー送受信の ための標準プロトコル(データ形式) 送信 • エクスポーターによって独⾃プロトコルに対応 • プル型も対応可能

Slide 11

Slide 11 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. テレメトリーパイプラインの パターン 11

Slide 12

Slide 12 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. テレメトリーパイプラインとは 後の保存と分析のためにテレメトリーの処理を⾏うパイプライン • メタデータの付与 • テレメトリーの集約 • テレメトリーのフィルター • ルーティング etc... 12 マクロパイプライン 内部パイプライン

Slide 13

Slide 13 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. 内部パイプラインの例 13 app: user otlp app: user k8s.node.name: worker-a2d4 k8s.pod.name: user-cf81 k8s.pod.uid: xxxxx k8s.pod.start_time: xxxxx k8s.deployment.name: xxxxx … otlp k8sattributes attributes app: user node: worker-a2d4 pod: user-cf81

Slide 14

Slide 14 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. マクロパイプラインのパターン テレメトリーパイプラインのパターンを分類する上での検討事項 • システムコンポーネント数 • インスタンス数 • スケーラビリティ • ランタイム • ネットワーク etc… 14

Slide 15

Slide 15 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. パターン1: 直結 15 利点 • コレクターがいないのでシンプル • 送信元とバックエンドの関係性が明らか ⽋点 • 各アプリにエクスポーター⽤の設定が必要 • エクスポーター⽤の設定が外部から変更不可 • 各アプリが個別にホストやクラスターに関する メタデータを付与 • 各アプリがテレメトリーの変換処理を実施 • バックエンドに向けて通信の設定 トレース メトリクス

Slide 16

Slide 16 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. パターン2: サイドカー 16 利点 • アプリ側の送信情報を変更しなくてよい • 内部パイプラインで共通のメタデータを ⾃動挿⼊できる • テレメトリーの変換処理をコレクターに オフロード可能 ⽋点 • バックエンドに向けて通信の設定 • サイドカーの設定が追加 トレース メトリクス

Slide 17

Slide 17 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. パターン3: プロキシ 17 利点 • 送信先はプロキシのコレクターのみでよい • 全アプリ共通の処理をまとめてプロキシに オフロードできる • プロキシとバックエンド間のみ通信できれ ばよい • バックエンド向けエクスポーターの設定が プロキシに集約できる • トレース全体の情報に基づいた集約が可能 ⽋点 • スケールするとプロキシに必要な計算資源 が⼤きくなる • プロキシがSPOFになる • トレースの集約をすると送信が遅れる トレース メトリクス OTLP

Slide 18

Slide 18 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. 補⾜: トレースの集約 18 250ms レイテンシーによるテイルサンプリングを したい場合は全スパンを待つ必要がある

Slide 19

Slide 19 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. パターン4: コレクタープール 19 利点 • プロキシパターンの利点全般 • マクロパイプラインのスケーラビリティ が上がる ⽋点 • 構成が複雑になる • トレースの集約ができなくなる トレース メトリクス OTLP

Slide 20

Slide 20 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. パターン4: コレクタープール 20 利点 • サーバレス構成の場合にも対応しやすい ⽋点 • サービスの起動が遅くなる

Slide 21

Slide 21 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. 検討事項 21

Slide 22

Slide 22 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. 検討事項 22 すべてのパターンに共通する主要な検討事項 • CPU/メモリの消費量 • バイナリサイズ • スケーラビリティ • 構成の複雑度 • フィルタリング/サンプリング • トランザクション全体を元にした集約の必要性

Slide 23

Slide 23 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. CPU/メモリの消費量 アプリケーションやコレクターのオブザーバビリティも必要 23 プロセッサーの調整 • Batch • Memory Limiter 内部テレメトリーの送信 service: telemetry: metrics: readers: - periodic: exporter: otlp: protocol: grpc/protobuf endpoint: http://localhost:14317 zPages や pprof の活⽤ extensions: health_check: pprof: zpages: service: extensions: [health_check, pprof, zpages]

Slide 24

Slide 24 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. バイナリサイズ 起動時間の短縮とリソース消費の抑制 24 otelcol-otlp otelcol otelcol-contrib ADOT 最新バージョン 0.118.0 0.118.0 0.118.0 0.42.0 バイナリサイズ※1 8.18MB 28.1MB 68.9 MB 34.3MB コンポーネント数 5 34 212 47 配布元 公式 公式 公式 AWS ※1 ARM64 の deb パッケージのサイズ ⽤途に合わせたディストリビューションを選択 必要ならば ocb を⽤いて⾃前ビルド

Slide 25

Slide 25 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. スケーラビリティと構成の複雑度 中規模以上のマイクロサービスには柔軟な構成が必要 25 スケーラビリティと構成の複雑度は⽐例 • デプロイメント • アクセス制御(IAMロール、KMS) • ネットワーク • 各コレクターの監視体制

Slide 26

Slide 26 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. フィルタリング/サンプリング 全量取得ができない場合もある 26 予算の都合、オーバーヘッド削減、法律・規制 • Filter • Reduction • Transform • Tail Sampling • Probabilistic Sampling

Slide 27

Slide 27 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. トランザクション全体を元にした集約の必要性 Tail Sampling が代表例 27 バッファリングが必要なケースがある • Tail Sampling • コネクター全般

Slide 28

Slide 28 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpenTelemetry の今後の展望 28

Slide 29

Slide 29 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpenTelemetry の今後の発展 29 テレメトリーパイプラインに関するアップデート • コレクタープール管理⽤のプロトコルとコントロールプレーン • テレメトリーデータ変換⽤の DSL • Apache Arrow への対応

Slide 30

Slide 30 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpAMP (Open Agent Management Protocol) コレクタープール管理⽤のプロトコルとコントロールプレーン 30 コレクター OpAMP Client OpAMP Supervisor OpAMP Client OpAMP Server 新しい設定 OpAMPプロトコル 既存の設定に新しい設定を マージした設定を作成 1 2 3 新しい設定を読み込ませて 再起動させる OpAMPの実装 ステータス AcceptsRemoteConfig ✅ ReportsEffectiveConfig ⚠ AcceptsPackages ⚠ ReportsPackageStatuses 📅 ReportsOwnMetrics 📅 ReportsOwnLogs ⚠ AcceptsOpAMPConnectionSettings 📅 AcceptsOtherConnectionSettings ⚠ AcceptsRestartCommand ⚠ ReportsHealth ⚠ ReoprtsRemoteConfig ⚠

Slide 31

Slide 31 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OTTL (OpenTelemetry Transformation Language) テレメトリーデータ変換⽤の DSL 31 次のプロセッサーで共通で使⽤可能 (2025年1⽉現在はアルファ) • Transform プロセッサー • Filter プロセッサー • Tail Sampling プロセッサー • Routing コネクター transform: error_mode: ignore metric_statements: - context: metric conditions: - type == METRIC_DATA_TYPE_SUM and Len(data_points) > 0 statements: - set(description, "Sum")

Slide 32

Slide 32 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. OpenTelemetry Protocol with Apache Arrow (otel-arrow) ⾼圧縮⾼スループットのプロトコル 32 OTLP に Apache Arrow を載せる • データを Apache Arrow 形式にして転送 • Apache Arrow Flight をサポートするわけでは ない • ⼤量データが定常的に来るコレクターに向いて いる • ステートフルなためロードバランサーなどに配 置する場合は注意 OTEP-0156 より

Slide 33

Slide 33 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. まとめ • 代表的な OpenTelemetry のテレメトリーパイプラインの構成 • 各パターンに利点・⽋点がある • 検討事項に応じてパターンがある程度選択できる • OpenTelemetry ではテレメトリーパイプラインを便利にする機能拡張がされて いる 33

Slide 34

Slide 34 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. Do more with AWS Builder ID 34 AWS Builder IDで • AWS Skill Builder の600以上の無料コース • Amazon Q Developer などのツールの利⽤ • AWS builders コミュニティ への参加 が可能になります。

Slide 35

Slide 35 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. Thank you! © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Trademark. Yoshi Yamaguchi @ymotongpoo