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
1.9k
お絵かきとScrapbox / Painting and Scrapbox
castaneai
0
800
Other Decks in Programming
See All in Programming
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
CSC305 Lecture 08
javiergs
PRO
0
280
Claude CodeによるAI駆動開発の実践 〜そこから見えてきたこれからのプログラミング〜
iriikeita
0
360
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
270
What's new in Spring Modulith?
olivergierke
1
170
Six and a half ridiculous things to do with Quarkus
hollycummins
0
220
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.4k
CSC305 Lecture 09
javiergs
PRO
0
310
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
980
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
260
オンデバイスAIとXcode
ryodeveloper
0
130
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
250
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Being A Developer After 40
akosma
91
590k
Typedesign – Prime Four
hannesfritz
42
2.8k
How to Ace a Technical Interview
jacobian
280
24k
Mobile First: as difficult as doing things right
swwweet
225
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
930
Speed Design
sergeychernyshev
32
1.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
The Cult of Friendly URLs
andyhume
79
6.6k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
640
Testing 201, or: Great Expectations
jmmastey
45
7.7k
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 対応も