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
castaneai
June 27, 2019
Programming
2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPでもTraceがしたい!! / Introduction of OpenCensus for PHP
OpenCensus/OpenTelemetry meetup vol.2 での発表資料です
https://opencensus.connpass.com/event/132588/
castaneai
June 27, 2019
More Decks by castaneai
See All by castaneai
Cloud Gaming Platform with Go
castaneai
2
3k
自己紹介と、環境と、Scrapboxのすすめ / engineer_ekaki self-introduction
castaneai
1
2.1k
お絵かきとScrapbox / Painting and Scrapbox
castaneai
0
870
Other Decks in Programming
See All in Programming
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
140
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
210
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
140
act1-costs.pdf
sumedhbala
0
230
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.9k
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
110
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
960
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
510
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
190
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
250
Featured
See All Featured
The Curse of the Amulet
leimatthew05
2
13k
Color Theory Basics | Prateek | Gurzu
gurzu
0
390
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
250
Designing for Timeless Needs
cassininazir
1
370
Ruling the World: When Life Gets Gamed
codingconduct
0
280
Abbi's Birthday
coloredviolet
3
8.7k
Code Review Best Practice
trishagee
74
20k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
280
WCS-LA-2024
lcolladotor
0
720
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
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 対応も