Giter Site home page Giter Site logo

sushilsingh27 / php-tracing-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from factorysh/php-tracing-tool

0.0 0.0 0.0 11.17 MB

Command line tool written in python - based on the BCC toolkit (eBPF) - for PHP code monitoring

License: Apache License 2.0

Shell 35.39% Python 27.89% PHP 3.91% Makefile 2.35% Dockerfile 30.46%

php-tracing-tool's Introduction

PHP Tracing Tool

PHP tracing tool is a command line tool written in python 3 - based on the BCC toolkit (eBPF) - for PHP code monitoring.

Built to help you understand your program behavior in a "normal" environment, directly in production.

It gives a deep observability of the application without adding specific php debugging code : function execution flow with latency of each function, tracing I/O syscalls with details …

You can also monitor your containerized application because it works on the PID of the php process, it discuss directly with the kernel (eBPF), there is no impact on your application. You just need a PHP compiled with the --enable-dtrace debug option (the image is in the repo)

screenshot

This example trace a demo php program with a google maps API call.

Command line options

-h : help

-S : print the syscalls details inside each function

--check : print the generated BPF C program and quit

--debug : debug mode: print the generated BPF C program

Install an usage

Be sure to have BCC on your machine (a Debian Buster).

apt-get install bpfcc-tools python3-bpfcc

Execute the script as root :

sudo ./php_tool.py -h

Complete Demo

Setup the vagrant machine and go in

cd vagrant-buster && vagrant up
vagrant ssh
cd /vagrant/php_tool

Launch the PHP demo and nginx containers

make

Instrumenting the code with php_tool

sudo ./php_tool.py -S PID [PID ...]

Usage

sudo ./php_tool.py

There is also a Wordpress demo image.

Licence

Apache-2.0 © 2019 Nicolas Dubouilh, Mathieu Lecarme

php-tracing-tool's People

Contributors

nirae avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.