Skip to content

sbaum1994/php-angular1-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

php-angular1-sample

PHP Angular App showing an example of OpenTracing (LightStep) context propagation

The PHP backend is a simple proxy server. The Angular frontend is generated by the Angular sample app generator using Angular 1. The PHP dependencies are loaded via composer.

How to run the example

Add to an Apache Server to view (for example, your /Sites folder) and navigate to http://localhost/fe/app. The console log will show browser tracing events since verbosity is set to 4. Replace {ACCESS_TOKEN_HERE} with a LightStep access token. Clicking the button "backend request" will send a url to the proxy.php server, which then sends a request to a hypothetical backend service, in this case a free website for json data.

How it works

The tracer is created in the TracerService Angular service. To use tracing within Angular modules, add the TracerService dependency, see the view1 module for reference. The TracerService is a singleton service, additional functionality and shortcuts can extend that service (currently it only gets the LightStep tracer).

The tracer on the PHP script is created at the invocation of the script and the "join" function is used to extract span context from the frontend request. Opentracing-php is listed as an optional dependency.

About

PHP Angular App showing an example of OpenTracing (LightStep) context propagation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors