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
0
1.7k
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.6k
自己紹介と、環境と、Scrapboxのすすめ / engineer_ekaki self-introduction
castaneai
1
1.8k
お絵かきとScrapbox / Painting and Scrapbox
castaneai
0
680
Other Decks in Programming
See All in Programming
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
120
XP2024 っていう国際会議に行ってきたよの記 / XP2024 Conference Report
bonotake
4
200
文化が生産性を作る
jimpei
3
540
全方位強化 Python 服務可觀測性:以 FastAPI 和 Grafana Stack 為例
blueswen
1
370
ファーストペンギンBot @Qiita Hackathon 2024 予選
dyson_web
0
220
モジュラモノリス、その前に / Modular monolith, before that
euglena1215
6
660
Micro Frontends for Java Microservices - dev2next 2024
mraible
PRO
0
200
.NET Aspireのクラウド対応検証: Azureと他環境での実践
ymd65536
1
360
DevFest Android in Korea 2024 - 안드로이드의 문단속 : 앱을 지키는 암호화 이야기
mdb1217
1
140
Remix × Cloudflare Pages × Sentry 奮闘記 / remix-pages-sentry
nkzn
1
390
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
250
NEWTにおけるiOS18対応の進め方
ryu1sazae
0
210
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
WebSockets: Embracing the real-time Web
robhawkes
59
7.3k
Why Our Code Smells
bkeepers
PRO
334
57k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Code Review Best Practice
trishagee
62
16k
Large-scale JavaScript Application Architecture
addyosmani
509
110k
Designing with Data
zakiwarfel
98
5.1k
How to Think Like a Performance Engineer
csswizardry
16
1k
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 対応も