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.8k
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.7k
自己紹介と、環境と、Scrapboxのすすめ / engineer_ekaki self-introduction
castaneai
1
1.9k
お絵かきとScrapbox / Painting and Scrapbox
castaneai
0
730
Other Decks in Programming
See All in Programming
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
170
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
ソフトウェアエンジニアの成長
masuda220
PRO
12
2.1k
複数のAWSアカウントから横断で 利用する Lambda Authorizer の作り方
tc3jp
0
120
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
41
16k
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
930
コードを読んで理解するko build
bells17
1
110
PEPCは何を変えようとしていたのか
ken7253
3
290
React 19アップデートのために必要なこと
uhyo
8
1.5k
Honoとフロントエンドの 型安全性について
yodaka
7
1.5k
LINE messaging APIを使ってGoogleカレンダーと連携した予約ツールを作ってみた
takumakoike
0
120
Featured
See All Featured
Fireside Chat
paigeccino
35
3.2k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.4k
Statistics for Hackers
jakevdp
797
220k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Become a Pro
speakerdeck
PRO
26
5.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
440
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Faster Mobile Websites
deanohume
306
31k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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 対応も