2017 © Pedro Peláez
 

library cloud-monitoring

Stackdriver Monitoring Client for PHP

image

google/cloud-monitoring

Stackdriver Monitoring Client for PHP

  • Thursday, July 19, 2018
  • by bshaffer
  • Repository
  • 37 Watchers
  • 0 Stars
  • 5,369 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 30 Versions
  • 25 % Grown

The README.md

Stackdriver Monitoring

Latest Stable Version Packagist, (*1)

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

Stackdriver Monitoring provides visibility into the performance, uptime, and overall health of cloud-powered applications., (*3)

Installation

To begin, install the preferred dependency manager for PHP, Composer., (*4)

Now install this component:, (*5)

$ composer require google/cloud-monitoring

This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our gRPC installation guide., (*6)

Authentication

Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests., (*7)

Sample

use Google\Api\Metric;
use Google\Api\MonitoredResource;
use Google\Cloud\Monitoring\V3\MetricServiceClient;
use Google\Cloud\Monitoring\V3\Point;
use Google\Cloud\Monitoring\V3\TimeInterval;
use Google\Cloud\Monitoring\V3\TimeSeries;
use Google\Cloud\Monitoring\V3\TypedValue;
use Google\Protobuf\Timestamp;

$metricServiceClient = new MetricServiceClient();
$formattedProjectName = $metricServiceClient->projectName($projectId);
$labels = [
    'instance_id' => $instanceId,
    'zone' => $zone,
];

$m = new Metric();
$m->setType('custom.googleapis.com/my_metric');

$r = new MonitoredResource();
$r->setType('gce_instance');
$r->setLabels($labels);

$value = new TypedValue();
$value->setDoubleValue(3.14);

$timestamp = new Timestamp();
$timestamp->setSeconds(time());

$interval = new TimeInterval();
$interval->setStartTime($timestamp);
$interval->setEndTime($timestamp);

$point = new Point();
$point->setValue($value);
$point->setInterval($interval);
$points = [$point];

$timeSeries = new TimeSeries();
$timeSeries->setMetric($m);
$timeSeries->setResource($r);
$timeSeries->setPoints($points);

try {
    $metricServiceClient->createTimeSeries($formattedProjectName, [$timeSeries]);
    print('Successfully submitted a time series' . PHP_EOL);
} finally {
    $metricServiceClient->close();
}

Debugging

Please see our Debugging guide for more information about the debugging tools., (*8)

Version

This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority., (*9)

Next Steps

  1. Understand the official documentation.
  2. Take a look at in-depth usage samples.

The Versions

19/07 2018

dev-master

9999999-dev

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

19/07 2018

v0.11.2

0.11.2.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

03/07 2018

v0.11.1

0.11.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

12/06 2018

v0.11.0

0.11.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

31/05 2018

v0.10.1

0.10.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

24/05 2018

v0.10.0

0.10.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

08/05 2018

v0.9.4

0.9.4.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

16/04 2018

v0.9.3

0.9.3.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

11/04 2018

v0.9.2

0.9.2.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

03/04 2018

v0.9.1

0.9.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

28/03 2018

v0.9.0

0.9.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

16/03 2018

v0.8.3

0.8.3.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

26/02 2018

v0.8.2

0.8.2.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

01/02 2018

v0.8.1

0.8.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

23/01 2018

v0.8.0

0.8.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

29/12 2017

v0.7.3

0.7.3.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

22/12 2017

v0.7.2

0.7.2.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

16/12 2017

v0.7.1

0.7.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

02/12 2017

v0.7.0

0.7.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

15/11 2017

v0.6.1

0.6.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

01/11 2017

v0.6.0

0.6.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

17/10 2017

v0.5.0

0.5.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

05/09 2017

v0.4.3

0.4.3.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

25/08 2017

v0.4.2

0.4.2.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

12/07 2017

v0.4.1

0.4.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

01/07 2017

v0.4.0

0.4.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

25/05 2017

v0.3.0

0.3.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

19/05 2017

v0.2.1

0.2.1.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

18/05 2017

v0.2.0

0.2.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

10/03 2017

v0.1.0

0.1.0.0

Stackdriver Monitoring Client for PHP

  Sources   Download

Apache-2.0

The Requires