Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
OpenTelemetry + LLM = OpenLLMetry!?
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yunosuke Yamada
May 14, 2025
Programming
1.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
OpenTelemetry + LLM = OpenLLMetry!?
Yunosuke Yamada
May 14, 2025
More Decks by Yunosuke Yamada
See All by Yunosuke Yamada
AI時代に成長するエンジニアに必要なスキルとは.pdf
yunosukey
0
230
Gemini CLIでもセキュアで堅牢な開発をしたい!
yunosukey
1
650
DevOps/MLOpsに学ぶエージェントの可観測性
yunosukey
1
1.2k
Agent Development Kitで作るマルチエージェントアプリケーション(AIAgent勉強会)
yunosukey
4
1.9k
Agent Development Kitで作るマルチエージェントアプリケーション(GCNT2025)
yunosukey
0
86
AIエージェントのオブザーバビリティについて
yunosukey
1
930
クラウド開発環境Cloud Workstationsの紹介
yunosukey
0
470
フロントエンドオブザーバビリティ on Google Cloud
yunosukey
1
380
ChatGPTのアルゴリズム
yunosukey
0
450
Other Decks in Programming
See All in Programming
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
340
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
280
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
130
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
React本体のコードリーディング
high_g_engineer
1
150
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
110
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
580
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
200
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
200
仕様駆動開発の消費期限
watany
20
8.8k
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
130
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
160
Featured
See All Featured
From π to Pie charts
rasagy
0
310
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
170
The Cult of Friendly URLs
andyhume
79
7k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
420
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
490
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
OpenTelemetry + LLM = OpenLLMetry!? Jagu'e'r オブザービリティ分科会 Meetup#2 株式会社スリーシェイク 山田悠之介
Copyright © 3-shake, Inc. All Rights Reserved.
宣伝 弊社有志による技術勉強会 『3-shake SRE Tech Talk #12 オンサイト』が あさって(5/16)開催されます! 今回のテーマはオブザーバビリティとなっております。
オンライン、オフラインともに余裕があるので お時間ある方はぜひ! 2
生成AIアプリとオブザーバビリティ ここ1、2年でRAGやAIエージェントなど生成AIを利用したアプリケーションが増加 生成AIアプリの難しさに対してオブザーバビリティを考える必要性 3 何が生成 される? どれくらい 時間がかかる? どれくらい お金がかかる?
巨大な ワークフロー 外部サービス の呼び出し モデルの更新
OpenLLMetry、OpenLIT いくつか解決策の方針があります 解決策 4 監視SaaSの機能を利用する OpenTelemetryを利用する 専用のツールを利用する DatadogのLLM Observability、 New
RelicのAI monitoring、 SentryのLLM Monitoringなど LangSmith、Langfuse
OpenLLMetryとは LLM向けにOpenTelemetryを拡張したOSS 特徴 • 監視ツールに依存しない計装 • 独自のテレメトリも収集可能 • Python、Node.js、Go、Rubyに対応 こんな場合にオススメ
• 既存の監視でOpenTelemetryを使っている • LLM Monitoring機能のあるSaaS、ツールを使っていない 万人向けではない • 監視ツールは「作るのではなく買う」『入門 監視』 5 https://docs.kloudmate.com/openllmetry-opentelemetry-based-observability-for-llms
どのような値が取れるか • OpenTelemetry側にSemantic conventions for generative AI systems というのがあり、概ねそれに準拠している ◦
というかOpenLLMetryのセマンティック規約が OpenTelemetryに取り込まれたらしい • 一部を抜粋すると ◦ ベンダー、モデル ◦ 生成の設定(max_tokens、temperature、top_p) ◦ リクエストとレスポンス、トークン数 6
インテグレーション 主な計装対象(一部抜粋) • Anthropic • Amazon Bedrock • OpenAI、Azure OpenAI
• LangChain • Gemini AI、Vertex AI 主な送信先(一部抜粋) • OpenTelemetry Collector、Grafana • Datadog、Dynatrace、New Relic、Sentry、Splunk • Google Cloud、Azure 7
やってみる Pythonでの自動計装 8 from opentelemetry.exporter.cloud_logging import CloudLoggingExporter from opentelemetry.exporter.cloud_trace import
CloudTraceSpanExporter from opentelemetry.exporter.cloud_monitoring import CloudMonitoringMetricsExporter from traceloop.sdk import Traceloop Traceloop.init( app_name="your-app-name", exporter=CloudTraceSpanExporter(), metrics_exporter=CloudMonitoringMetricsExporter(), logging_exporter=CloudLoggingExporter(), )
やってみる Vertex AI SDKを使った呼び出し 9 import vertexai from vertexai.generative_models import
GenerativeModel vertexai.init( project=PROJECT_ID, location=LOCATION, ) model = GenerativeModel("gemini-2.5-flash-preview-04-17") response = model.generate_content("OpenTelemetryって何?")
やってみる Traceエクスプローラで確認 10
自動計装の実装を見てみる(1) 自動計装対象のメソッドの一覧 11 WRAPPED_METHODS = [ { "package": "vertexai.generative_models", "object":
"GenerativeModel", "method": "generate_content", "span_name": "vertexai.generate_content", "is_async": False, }, ... https://github.com/traceloop/openllmetry/blob/7a1b8bbea7fcffb2f7cbd127fada7b6c7b046280/packages/ opentelemetry-instrumentation-vertexai/opentelemetry/instrumentation/vertexai/__init__.py#L29-L36
自動計装の実装を見てみる(2) wraptによるラッピング 12 for wrapped_method in WRAPPED_METHODS: wrap_package = wrapped_method.get("package")
wrap_object = wrapped_method.get("object") wrap_method = wrapped_method.get("method") wrap_function_wrapper( wrap_package, f"{wrap_object}.{wrap_method}", ( _awrap(tracer, wrapped_method) if wrapped_method.get("is_async") else _wrap(tracer, wrapped_method) ), ) https://github.com/traceloop/openllmetry/blob/7a1b8bbea7fcffb2f7cbd127fada7b6c7b046280/packages /opentelemetry-instrumentation-vertexai/opentelemetry/instrumentation/vertexai/__init__.py#L360-L3
自動計装の実装を見てみる(3) ラッパーの処理 13 span = tracer.start_span( name, kind=SpanKind.CLIENT, attributes={ SpanAttributes.LLM_SYSTEM:
"VertexAI", SpanAttributes.LLM_REQUEST_TYPE: LLMRequestTypeValues.COMPLETION.value, }, ) _handle_request(span, args, kwargs, llm_model) response = wrapped(*args, **kwargs) if response: if is_streaming_response(response): return _build_from_streaming_response(span, response, llm_model) elif is_async_streaming_response(response): return _abuild_from_streaming_response(span, response, llm_model) else: _handle_response(span, response, llm_model) span.end() return response https://github.com/traceloop/openllmetry/blob/7a1b8bbea7fcffb2f7cbd127fada7b6c7b046280/pack ages/opentelemetry-instrumentation-vertexai/opentelemetry/instrumentation/vertexai/__init__.py# L322-L344 入力の情報をスパン属性に追加 出力の情報をスパン属性に追加、など
注意点 • Google Gen AI SDKは未対応 ◦ Gen AI SDK:Gemini
APIとVertex AIを統一的に扱えるライブラリ ◦ https://github.com/traceloop/openllmetry/issues/2675 • OpenTelemetryのセマンティック規約に完全に準拠しているわけではない ◦ 例えばプロンプトのイベント ▪ https://github.com/traceloop/openllmetry/issues/2456 ◦ とはいえOpenTelemetryの生成AIのセマンティック規約自体がDevelopmentではある 14
まとめ • 生成AIアプリケーションもオブザーバビリティが必要 • 解決策の1つとしてOpenLLMetryによるOTel計装があり、 自動計装することができる • Gen AI SDKの対応やOpenTelemetryのセマンティック規約への準拠など
発展途上な部分もある 15