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.9k
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
800
Other Decks in Programming
See All in Programming
AIのバカさ加減に怒る前にやっておくこと
blueeventhorizon
0
130
CSC509 Lecture 08
javiergs
PRO
0
270
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
200
Claude Agent SDK を使ってみよう
hyshu
0
1.5k
CSC305 Lecture 10
javiergs
PRO
0
330
data-viz-talk-cz-2025
lcolladotor
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
460
業務でAIを使いたい話
hnw
0
220
外接に惑わされない自システムの処理時間SLIをOpenTelemetryで実現した話
kotaro7750
0
150
AkarengaLT vol.38
hashimoto_kei
1
130
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
260
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
5
1.1k
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Designing for Performance
lara
610
69k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Balancing Empowerment & Direction
lara
5
710
Keith and Marios Guide to Fast Websites
keithpitt
412
23k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Typedesign – Prime Four
hannesfritz
42
2.8k
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 対応も