saschahemleb/php-grafana-api-client

Grafana API client written in PHP

v1.0.0-alpha.2 2023-07-20 07:27 UTC

This package is auto-updated.

Last update: 2024-04-20 09:00:32 UTC


README

A client for the Grafana API, written in PHP.

Project Status

This project is still in an alpha state; not all API endpoints are implemented yet, and the public package API is subject to major changes.

Installation

Via Composer

$ composer require saschahemleb/php-grafana-api-client

Framework Integration

I've written a bridge package for Laravel, providing a facade and a connection manager for controlling multiple grafana instances. You can find it here.

Example

use Saschahemleb\PhpGrafanaApiClient\Client;
use Saschahemleb\PhpGrafanaApiClient\Authentication;

$client = Client::create(
    new Uri('http://localhost:3000/'), // url to grafana
    Authentication::basicAuth('admin', 'admin')
);

echo $client->other()->health()->getVersion();
// 8.3.6