belka-tech/gauge-exporter-client

0.1.0 2024-10-01 06:23 UTC

This package is not auto-updated.

Last update: 2025-01-07 11:00:02 UTC


README

PHP Client for Gauge Exporter.

Usage example

<?php

use BelkaTech\GaugeExporterClient\GaugeExporterClient;
use BelkaTech\GaugeExporterClient\MetricBag;
use GuzzleHttp\Client;

require_once "vendor/autoload.php";

$bag = new MetricBag('metric-name');
$bag->increment(['a' => 'b'], 100);
$bag->increment(['a' => 'b', 'c' => 'd'], 500);

$client = new GaugeExporterClient(new Client(), 'https://127.0.0.1:8181', ['env' => 'prod']);
$client->send($bag, 150);