GithubHelp home page GithubHelp logo

isabella232 / lightstep-tracer-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bigcommerce/lightstep-tracer-php

0.0 0.0 0.0 10.18 MB

The Lightstep distributed tracing library for PHP

Home Page: https://lightstep.com

License: MIT License

PHP 59.12% Makefile 0.53% CSS 4.07% JavaScript 16.52% Twig 19.75%

lightstep-tracer-php's Introduction

lightstep-tracer-php

Latest Stable Version Circle CI MIT license

The LightStep distributed tracing library for PHP.

Installation

composer require lightstep/tracer

The lightstep/tracer package is available here on packagist.org.

Getting started

<?php

require __DIR__ . '/vendor/autoload.php';

LightStep::initGlobalTracer('examples/trivial_process', '{your_access_token}');

$span = LightStep::startSpan("trivial/loop");
for ($i = 0; $i < 10; $i++) {
    $span->logEvent("loop_iteration", $i);
    echo "The current unix time is " . time() . "\n";
    usleep(1e5);
    $child = LightStep::startSpan("child_span", array(parent => $span));
    usleep(2e5);
    $child->logEvent("hello world");
    $child->finish();
    usleep(1e5);
}
$span->finish();

See lib/api.php for detailed API documentation.

Setting collector endpoint and port

You can override the default endpoint and port that spans are sent to by setting collector_host and collector_port options when initalizing the tracer.

For example when using the global initializer:

LightStep::initGlobalTracer('examples/trivial_process', '{your_access_token}', [
    'collector_host' => '<FDQN or IP>',
    'collector_port' => '<port>'
]);

By default the the tracer sends trace data securely to the public LightStep satellites at collector.lightstep.com over port 443 using TLS.

Developer Setup

brew install composer
make install
make test

lightstep-tracer-php's People

Contributors

aliceadelef avatar austinlparker avatar backtrak avatar bbrothers avatar bcronin avatar bg451 avatar frenchfrywpepper avatar iredelmeier avatar karticus avatar krishicks avatar kuthz avatar lord2800 avatar mikegoldsmith avatar nimeshksingh avatar xerxesdgreat 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.