GoogleCloudPlatform/google-cloud-php-trace

Name: google-cloud-php-trace

Owner: Google Cloud Platform

Description: null

Created: 2017-05-17 23:35:39.0

Updated: 2018-05-08 16:21:57.0

Pushed: 2018-05-08 16:21:56.0

Homepage: null

Size: 109

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Google PHP Stackdriver Trace

Idiomatic PHP client for Stackdriver Trace.

Latest Stable Version Packagist

NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.

Use of the included generated clients requires installation of the gRPC PHP extension. For instructions, see here.

NOTE: In addition to the gRPC extension, we recommend installing the protobuf extension for improved performance. For installation instructions, see here.

Installation

Install with composer or add to your composer.json.

mposer require google/cloud-trace

Use of the included generated clients requires installation of the gRPC PHP extension. For instructions, see here.

NOTE: In addition to the gRPC extension, we recommend installing the protobuf extension for improved performance. For installation instructions, see here.

Usage

This library contains code to interact with the Stackdriver Trace V2 API.

Creating a Trace
Google\Cloud\Trace\TraceClient;

ent = new TraceClient();
ce = $client->trace();
n = $trace->span(['name' => 'main']);
ce->setSpans([$span]);

ent->insert($trace);
Using OpenCensus

We highly recommend using the OpenCensus project to instrument your application. OpenCensus is an open source, distributed tracing framework that maintains integrations with popular frameworks and tools. OpenCensus provides a data exporter for Stackdriver Trace which uses this library. If you were using google/cloud-trace <= v0.3.3 or google/cloud <= 0.46.0, then check out the migration guide to OpenCensus.

Install with composer or add to your composer.json.

mposer require opencensus/opencensus

Use the provided StackdriverExporter when configuring your tracer.

OpenCensus\Trace\Exporter\StackdriverExporter;
OpenCensus\Trace\Tracer;

er::start(new StackdriverExporter());

See the OpenCensus documentation for more configuration options and features.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.