SlideShare a Scribd company logo
“Huston, we have an
AirBrake”
Application Error monitoring in PHP

meet.php #11
By @emgiezet
(c) 1995 Universal
$whoami
●

●
●

●

meet.php #11

Tech Lead @
Redexperts.net
With PHP since 2002
Sorry Ladies but I got
Wife.
Speaker @
{meet.php} since #8

2
Agenda
1. PHP error tracking
2. Airbrake
3. Errbit
4. emgiezet/errbitPHP
5. Case Study

meet.php #11

3
How I can track errors in PHP?
●

Override error handler

●

set_error_handler(
array($this, 'onError'),
error_reporting()
);

Override exception handler
set_exception_handler(
array($this, 'onException')
);

●

Use the shutdown
function
register_shutdown_function(
array($this, 'onShutdown')
);

meet.php #11

4
How do you track the errors?
●

Common Strategies:
–

Read Apache / ngnix / PHP Logs

–

Read application logs (ex. monolog)

–

Emails with Stack Traces

–

Wait until customer report some errors.

–

I'm so PRO that my application never crash on
production. xoxo

meet.php #11

5
Sudden error rate of 50% for your
Application

http://devopsreactions.tumblr.com/post/67741920428/sudden-error-rate-of-50-for-your-application

meet.php #11

6
How your customers reports an
error?
●

Link to the page is attached?

●

Time-stamp of the error occurrence to grep the log?

●

Is there any screen-shot or screen-cast attached?

●

Maybe some unicorns are dancing on rainbow?

meet.php #11

7
To repeat the error you must..
a) Play email ping-pong.
b) Dig the logs for the next few hours.
c) Daft Punk - Get Lucky?
d) Have a Error tracking application.

meet.php #11

8
AirBrake.io
●

Trusted by:
–

grupon
Oracle

–

SoundCloud +

–

●

Integrates with:
GitHub, Bitbucket, JIRA,
HipChat, Asana, Pivotal,
Flowdock, Campfire,
Lighthouse

●

Webhooks

●

Customer Support

meet.php #11

9
AirBrake.io Notifier API
<?xml version="1.0" encoding="UTF-8"?>
<notice version="2.3">
<api-key>76fdb93ab2cf276ec080671a8b3d3866</api-key>
<notifier>
<name>Airbrake Notifier</name>
<version>3.1.6</version>
<url>http://api.airbrake.io</url>
</notifier>
<error>
<class>RuntimeError</class>
<message>RuntimeError: I've made a huge mistake</message>
<backtrace>
<line method="public" file="/testapp/app/models/user.rb" number="53"/>
<line method="index" file="/testapp/app/controllers/users_controller.rb" number="14"/>
</backtrace>
</error>
<request>
<url>http://example.com</url>
<component/>
<action/>
<cgi-data>
<var key="SERVER_NAME">example.org</var>
<var key="HTTP_USER_AGENT">Mozilla</var>
</cgi-data>
</request>
<server-environment>
<project-root>/testapp</project-root>
<environment-name>production</environment-name>
<app-version>1.0.0</app-version>
</server-environment>
</notice>

meet.php #11

●

XML Based

●

RESTFull

10
Whoaaaa cool but give me the price
●

Small $39/Month

●

Enterprise $199/Month

–

–

30 Users

–

10 Projects

–

40 Projects

–
●

5 Users

Phone support

–

Custom setup

Medium $89/Month
–

20 Users

–

15 Projects

–

Phone support

–

Custom setup

meet.php #11

11
Can't afford AirBrake.
No time for negotiations.
It's time for OpenSource solution.

meet.php #11

12
Errbit
●

●

●

●

●

meet.php #11

Compatible API with
Airbrake Notifier API
Written in Ruby srsly
must be cool
Can be hosted at Heroku
freebie!
You know first when sth
is screwed up.
Setup takes one hour.

13
AirBrake vs Errbit
●
●

●

●

●

●

App count limited by plan
(max 40)
Hosted in atomic bomb
proof shelter

Freebie

●

Unlimited Apps and Users

●

God damn expensive

Can be hosted on heroku

Unlimited error retention

●

Super-fast notifications.
Application don't lags on
error reporting

●

meet.php #11

15 MB of MongoDB on
heroku free plan
Sleeping after 5 min of
inactivity

14
Results

3:3
Round Draw
OpenSource draw quite nice.
meet.php #11

15
Applications View

meet.php #11

16
Creating new App View

meet.php #11

17
Error View

meet.php #11

18
Backtrace Tab

meet.php #11

19
Environment tab

meet.php #11

20
Session tab

meet.php #11

21
Not enough?
●

Error Comments

●

Issue tracker integration:
–

Deploy hook
–

To clean your error
counter for previous
deploy

meet.php #11

BitBucket
Gitlab
Redmine

–

FogBugz

–

Mingle

–

Pivotal Labs

–

and replies with
notifications

Github

–
●

–

–

–

Sorry no Jira.
22
But how can I integrate Errbit with
my PHP App?
Requires:

●

–
–

●

PHP >= 5.3.2
Without cURL

Integrates with
–
–

Symfony2

–

Kohana 3

–

meet.php #11

Plain PHP esoteric mutants

...

23
History of errbit-php
●

Original concept was made
by:
flippa/errbit-php and
dbtlr/php-airbrake

●

90% of code were rewritten to match
psr-2.

●

80% LOC were covered by unit tests.

●

Added TravisCI build for
–
–

●

●

But both of them doesn't
work at all. And wasn't OOP.
Flippa don't accept any
pull-requests so:

PHP 5.4

–
●

PHP 5.3
PHP 5.5

Already have merged few pull
request

●

Got more than 200 Installs

●

Is linked in a readme of errbit/errbit ;)

meet.php #11

24
Enough bullshit. Time to code!
●

Symfony2 Integration

●

Plain PHP Integration

1. Add to composer.json

1. Download

2. Composer update

2. Add the “use” in your
“kernel” file

3. Create a Listener
onKernelException

3. Create an Errbit
instance

4. Register a service

4. Call the start()

5. Set the api key in
parameters.yml

5. Collect the errors

6. Collect the errors
meet.php #11

25
$php->code('now');

meet.php #11

26
Feel free to contribute!

meet.php #11

27
Use Cases
●

Tracking errors

●

Support test team

●

meet.php #11

Production live debugging

28
Where to put Errbit during the development?

meet.php #11

29
How the flow looks like?

meet.php #11

30
How the workflow looks like?

meet.php #11

31
Can we make it better?

meet.php #11

32
Advantages of using Errbit
●

You know first that error occurred.

●

You know much more than customer will report you.

●

●

●

You can fix the bug and make a #ninja deploy before customer
will notice the error.
Cloud solution friendly – no more grep'ing the error logs from
all PHP nodes
You care about the support and maintenance you gain lots of
professional #swag

meet.php #11

33
Things to remember
“Writing tests is our
professional responsibility”

●

●

~@jakub_zalas

meet.php #11

This is your last line of
defense.
Fix bugs and do the
homework in your next
projects

34
Q&A?

meet.php #11

35
Thank You!

meet.php #11

36

More Related Content

What's hot

Cowboy rabbit-websockets
Cowboy rabbit-websocketsCowboy rabbit-websockets
Cowboy rabbit-websockets
Wade Mealing
 
BackPAN Archeology
BackPAN ArcheologyBackPAN Archeology
BackPAN Archeology
brian d foy
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
nohuhu
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
Fwdays
 
It gilde 20150209
It gilde 20150209It gilde 20150209
It gilde 20150209
Martin Simons
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
Hanoi MagentoMeetup
 
Managing Complexity with Module::Release
Managing Complexity with Module::ReleaseManaging Complexity with Module::Release
Managing Complexity with Module::Release
brian d foy
 
Composer
ComposerComposer
Composer
Naseer Ahmad
 
Docker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopDocker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 Workshop
Chris Tankersley
 
OpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management ToolOpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management Tool
Alkacon Software GmbH & Co. KG
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
Jimmy Lu
 
Failing at Scale - PNWPHP 2016
Failing at Scale - PNWPHP 2016Failing at Scale - PNWPHP 2016
Failing at Scale - PNWPHP 2016
Chris Tankersley
 
Composer
ComposerComposer
Composer
Le Thanh Sang
 
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
Alkacon Software GmbH & Co. KG
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
Chang W. Doh
 
Perl
PerlPerl
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
Ortus Solutions, Corp
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency Manager
Ujjwal Ojha
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
php-user-group-minsk
 

What's hot (20)

Cowboy rabbit-websockets
Cowboy rabbit-websocketsCowboy rabbit-websockets
Cowboy rabbit-websockets
 
BackPAN Archeology
BackPAN ArcheologyBackPAN Archeology
BackPAN Archeology
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
 
It gilde 20150209
It gilde 20150209It gilde 20150209
It gilde 20150209
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
 
Managing Complexity with Module::Release
Managing Complexity with Module::ReleaseManaging Complexity with Module::Release
Managing Complexity with Module::Release
 
Composer
ComposerComposer
Composer
 
Docker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopDocker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 Workshop
 
OpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management ToolOpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management Tool
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 
Failing at Scale - PNWPHP 2016
Failing at Scale - PNWPHP 2016Failing at Scale - PNWPHP 2016
Failing at Scale - PNWPHP 2016
 
Composer
ComposerComposer
Composer
 
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Perl
PerlPerl
Perl
 
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency Manager
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 

Similar to meet.php #11 - Huston, we have an airbrake

Symfony2 - Request to Response
Symfony2 - Request to ResponseSymfony2 - Request to Response
Symfony2 - Request to Response
Palko Lenard
 
Server Independent Programming
Server Independent ProgrammingServer Independent Programming
Server Independent Programming
ZendCon
 
Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)
Stefan Koopmanschap
 
Owasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF SessionOwasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF Session
Bart Leppens
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
Programmer Blog
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7
Codemotion
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
Merixstudio
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
Wim Godden
 
Php7
Php7Php7
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
sosorry
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
Wim Godden
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.IL
Eran Harel
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
Wim Godden
 
DDD (Debugger Driven Development)
DDD (Debugger Driven Development)DDD (Debugger Driven Development)
DDD (Debugger Driven Development)
Carlos Granados
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009
PHPBelgium
 
Last Month in PHP - June 2016
Last Month in PHP - June 2016Last Month in PHP - June 2016
Last Month in PHP - June 2016
Eric Poe
 
Symfony Nano Framework
Symfony Nano FrameworkSymfony Nano Framework
Symfony Nano Framework
Loïc Faugeron
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
Engineor
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
Fabien Potencier
 
Php through the eyes of a hoster confoo
Php through the eyes of a hoster confooPhp through the eyes of a hoster confoo
Php through the eyes of a hoster confoo
Combell NV
 

Similar to meet.php #11 - Huston, we have an airbrake (20)

Symfony2 - Request to Response
Symfony2 - Request to ResponseSymfony2 - Request to Response
Symfony2 - Request to Response
 
Server Independent Programming
Server Independent ProgrammingServer Independent Programming
Server Independent Programming
 
Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)
 
Owasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF SessionOwasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF Session
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
Php7
Php7Php7
Php7
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.IL
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
DDD (Debugger Driven Development)
DDD (Debugger Driven Development)DDD (Debugger Driven Development)
DDD (Debugger Driven Development)
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009
 
Last Month in PHP - June 2016
Last Month in PHP - June 2016Last Month in PHP - June 2016
Last Month in PHP - June 2016
 
Symfony Nano Framework
Symfony Nano FrameworkSymfony Nano Framework
Symfony Nano Framework
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Php through the eyes of a hoster confoo
Php through the eyes of a hoster confooPhp through the eyes of a hoster confoo
Php through the eyes of a hoster confoo
 

Recently uploaded

PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 

Recently uploaded (20)

PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 

meet.php #11 - Huston, we have an airbrake

  • 1. “Huston, we have an AirBrake” Application Error monitoring in PHP meet.php #11 By @emgiezet (c) 1995 Universal
  • 2. $whoami ● ● ● ● meet.php #11 Tech Lead @ Redexperts.net With PHP since 2002 Sorry Ladies but I got Wife. Speaker @ {meet.php} since #8 2
  • 3. Agenda 1. PHP error tracking 2. Airbrake 3. Errbit 4. emgiezet/errbitPHP 5. Case Study meet.php #11 3
  • 4. How I can track errors in PHP? ● Override error handler ● set_error_handler( array($this, 'onError'), error_reporting() ); Override exception handler set_exception_handler( array($this, 'onException') ); ● Use the shutdown function register_shutdown_function( array($this, 'onShutdown') ); meet.php #11 4
  • 5. How do you track the errors? ● Common Strategies: – Read Apache / ngnix / PHP Logs – Read application logs (ex. monolog) – Emails with Stack Traces – Wait until customer report some errors. – I'm so PRO that my application never crash on production. xoxo meet.php #11 5
  • 6. Sudden error rate of 50% for your Application http://devopsreactions.tumblr.com/post/67741920428/sudden-error-rate-of-50-for-your-application meet.php #11 6
  • 7. How your customers reports an error? ● Link to the page is attached? ● Time-stamp of the error occurrence to grep the log? ● Is there any screen-shot or screen-cast attached? ● Maybe some unicorns are dancing on rainbow? meet.php #11 7
  • 8. To repeat the error you must.. a) Play email ping-pong. b) Dig the logs for the next few hours. c) Daft Punk - Get Lucky? d) Have a Error tracking application. meet.php #11 8
  • 9. AirBrake.io ● Trusted by: – grupon Oracle – SoundCloud + – ● Integrates with: GitHub, Bitbucket, JIRA, HipChat, Asana, Pivotal, Flowdock, Campfire, Lighthouse ● Webhooks ● Customer Support meet.php #11 9
  • 10. AirBrake.io Notifier API <?xml version="1.0" encoding="UTF-8"?> <notice version="2.3"> <api-key>76fdb93ab2cf276ec080671a8b3d3866</api-key> <notifier> <name>Airbrake Notifier</name> <version>3.1.6</version> <url>http://api.airbrake.io</url> </notifier> <error> <class>RuntimeError</class> <message>RuntimeError: I've made a huge mistake</message> <backtrace> <line method="public" file="/testapp/app/models/user.rb" number="53"/> <line method="index" file="/testapp/app/controllers/users_controller.rb" number="14"/> </backtrace> </error> <request> <url>http://example.com</url> <component/> <action/> <cgi-data> <var key="SERVER_NAME">example.org</var> <var key="HTTP_USER_AGENT">Mozilla</var> </cgi-data> </request> <server-environment> <project-root>/testapp</project-root> <environment-name>production</environment-name> <app-version>1.0.0</app-version> </server-environment> </notice> meet.php #11 ● XML Based ● RESTFull 10
  • 11. Whoaaaa cool but give me the price ● Small $39/Month ● Enterprise $199/Month – – 30 Users – 10 Projects – 40 Projects – ● 5 Users Phone support – Custom setup Medium $89/Month – 20 Users – 15 Projects – Phone support – Custom setup meet.php #11 11
  • 12. Can't afford AirBrake. No time for negotiations. It's time for OpenSource solution. meet.php #11 12
  • 13. Errbit ● ● ● ● ● meet.php #11 Compatible API with Airbrake Notifier API Written in Ruby srsly must be cool Can be hosted at Heroku freebie! You know first when sth is screwed up. Setup takes one hour. 13
  • 14. AirBrake vs Errbit ● ● ● ● ● ● App count limited by plan (max 40) Hosted in atomic bomb proof shelter Freebie ● Unlimited Apps and Users ● God damn expensive Can be hosted on heroku Unlimited error retention ● Super-fast notifications. Application don't lags on error reporting ● meet.php #11 15 MB of MongoDB on heroku free plan Sleeping after 5 min of inactivity 14
  • 15. Results 3:3 Round Draw OpenSource draw quite nice. meet.php #11 15
  • 17. Creating new App View meet.php #11 17
  • 22. Not enough? ● Error Comments ● Issue tracker integration: – Deploy hook – To clean your error counter for previous deploy meet.php #11 BitBucket Gitlab Redmine – FogBugz – Mingle – Pivotal Labs – and replies with notifications Github – ● – – – Sorry no Jira. 22
  • 23. But how can I integrate Errbit with my PHP App? Requires: ● – – ● PHP >= 5.3.2 Without cURL Integrates with – – Symfony2 – Kohana 3 – meet.php #11 Plain PHP esoteric mutants ... 23
  • 24. History of errbit-php ● Original concept was made by: flippa/errbit-php and dbtlr/php-airbrake ● 90% of code were rewritten to match psr-2. ● 80% LOC were covered by unit tests. ● Added TravisCI build for – – ● ● But both of them doesn't work at all. And wasn't OOP. Flippa don't accept any pull-requests so: PHP 5.4 – ● PHP 5.3 PHP 5.5 Already have merged few pull request ● Got more than 200 Installs ● Is linked in a readme of errbit/errbit ;) meet.php #11 24
  • 25. Enough bullshit. Time to code! ● Symfony2 Integration ● Plain PHP Integration 1. Add to composer.json 1. Download 2. Composer update 2. Add the “use” in your “kernel” file 3. Create a Listener onKernelException 3. Create an Errbit instance 4. Register a service 4. Call the start() 5. Set the api key in parameters.yml 5. Collect the errors 6. Collect the errors meet.php #11 25
  • 27. Feel free to contribute! meet.php #11 27
  • 28. Use Cases ● Tracking errors ● Support test team ● meet.php #11 Production live debugging 28
  • 29. Where to put Errbit during the development? meet.php #11 29
  • 30. How the flow looks like? meet.php #11 30
  • 31. How the workflow looks like? meet.php #11 31
  • 32. Can we make it better? meet.php #11 32
  • 33. Advantages of using Errbit ● You know first that error occurred. ● You know much more than customer will report you. ● ● ● You can fix the bug and make a #ninja deploy before customer will notice the error. Cloud solution friendly – no more grep'ing the error logs from all PHP nodes You care about the support and maintenance you gain lots of professional #swag meet.php #11 33
  • 34. Things to remember “Writing tests is our professional responsibility” ● ● ~@jakub_zalas meet.php #11 This is your last line of defense. Fix bugs and do the homework in your next projects 34