splunk/tracer

Splunk instrumentation API

Installs: 1 349

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 2

Language:HTML

0.1.0 2019-10-22 15:24 UTC

This package is auto-updated.

Last update: 2021-04-22 18:56:43 UTC


README

MIT license

The SplunkTracing distributed tracing library for PHP.

Installation

composer require splunk/tracer

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

Getting started

<?php

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

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

$span = SplunkTracing::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 = SplunkTracing::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.

Developer Setup

brew install composer
make install
make test

This library is the Splunk binding for OpenTracing. See the OpenTracing PHP API for additional detail.

License

The Splunk Tracer for PHP is licensed under the MIT License. Details can be found in the LICENSE file.

Third-party libraries

This is a fork of the PHP tracer from Lightstep, which is also licensed under the MIT License. Links to the original repository and license are below: