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
PHPでもTraceがしたい!! / Introduction of OpenCensus f...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
castaneai
June 27, 2019
Programming
0
2k
PHPでもTraceがしたい!! / Introduction of OpenCensus for PHP
OpenCensus/OpenTelemetry meetup vol.2 での発表資料です
https://opencensus.connpass.com/event/132588/
castaneai
June 27, 2019
Tweet
Share
More Decks by castaneai
See All by castaneai
Cloud Gaming Platform with Go
castaneai
2
2.9k
自己紹介と、環境と、Scrapboxのすすめ / engineer_ekaki self-introduction
castaneai
1
2k
お絵かきとScrapbox / Painting and Scrapbox
castaneai
0
840
Other Decks in Programming
See All in Programming
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
710
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
140
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
380
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
570
Unity6.3 AudioUpdate
cova8bitdots
0
130
Codex の「自走力」を高める
yorifuji
0
1.2k
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
140
20260315 AWSなんもわからん🥲
chiilog
1
110
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1k
Claude Codeログ基盤の構築
giginet
PRO
7
3k
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
860
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Documentation Writing (for coders)
carmenintech
77
5.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Building the Perfect Custom Keyboard
takai
2
710
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to Talk to Developers About Accessibility
jct
2
150
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
540
Discover your Explorer Soul
emna__ayadi
2
1.1k
A Modern Web Designer's Workflow
chriscoyier
698
190k
A Tale of Four Properties
chriscoyier
163
24k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
700
Transcript
PHPでも Traceがしたい! OpenTelemetry meetup vol.2
@castaneai GitHub castaneai Twitter castanea • OpenCensus for PHP Contributor
• ゲームのサーバーやさん • GCPの同人誌などを書いてます
突然ですが アンケート
PHPをメインで 使っている人?
None
None
PHPにもある! OpenCensus Instrumentation
census-instrumentation/opencensus-php
使い方
[1] Install opencensus package $ composer require opencensus/opencensus:~0.2
[2] Create Exporter $exporter = new StackdriverExporter();
[3] Start Tracing $exporter = new StackdriverExporter(); Tracer::start($exporter);
[4] Create Span $exporter = new StackdriverExporter(); Tracer::start($exporter); Tracer::inSpan(['name' =>
'test-span'], function () { sleep(1); echo 'hello'; });
[5] Done!!
OpenCensus for PHP のさらにすごい ところ
PHPインタプリタに 直接踏み込む Tracing
OpenCensus PHP Extension
[1] Install opencensus extension $ pecl install opencensus-alpha
[2] Enable the extension in php.ini extension=opencensus.so
[3] Watching for function invocation $exporter = new StackdriverExporter(); Tracer::start($exporter);
sleep(1); echo 'hello'; opencensus_trace_function('sleep');
[4] Done!!
ライブラリ内の関数でも built-in関数でも 直接手を加えずに Traceできる
よく使いそうなライブラリは Integration あり • curl (Guzzle) • gRPC • PDO
(Database driver) • Laravel • Wordpress • etc...
None
(Alpha) ... productionで使えないのでは…?
ライブラリのチューニングに役立った!
うおおお!! OpenCensus for PHP!! すごい!今すぐ試し たい!
でもPHPの 環境構築 面倒くさい… nginx?? fpm??
castaneai/php-opencensus-example docker-compose で すぐに試せるセット 作りました!!!
OpenCensus for PHP 最近の動向
OpenCensus Stats
OC Agent 対応も