Skip to content

Commit

Permalink
Add example for PushGateway usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bracki committed Sep 21, 2016
1 parent e8053e9 commit 6fd50fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/pushgateway.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
require __DIR__ . '/../vendor/autoload.php';

use Prometheus\CollectorRegistry;

$adapter = new Prometheus\Storage\APC();
$registry = new CollectorRegistry($adapter);

$counter = $registry->registerCounter('test', 'some_counter', 'it increases', ['type']);
$counter->incBy(6, ['blue']);

$pushGateway = new \Prometheus\PushGateway('192.168.59.100:9091');
$pushGateway->push($registry, 'my_job', array('instance'=>'foo'));

0 comments on commit 6fd50fc

Please sign in to comment.