PHPackages                             danibrutal/kairosdb-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. danibrutal/kairosdb-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

danibrutal/kairosdb-client
==========================

A client library for KairosDB written in PHP

21.7k3PHP

Since Jun 5Pushed 10y ago2 watchersCompare

[ Source](https://github.com/danibrutal/KairosDB-Client)[ Packagist](https://packagist.org/packages/danibrutal/kairosdb-client)[ RSS](/packages/danibrutal-kairosdb-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

KairosDB Client [![Build Status](https://camo.githubusercontent.com/6cf01bd773b223d1bc5e51de1fdc813cd40a2af4a4e075af0831637bd8ca43de/68747470733a2f2f7472617669732d63692e6f72672f64616e6962727574616c2f4b6169726f7344422d436c69656e742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/danibrutal/KairosDB-Client)
=============================================================================================================================================================================================================================================================================================================================

[](#kairosdb-client-)

Description
-----------

[](#description)

A client library for KairosDB written in PHP. This package provides convenience functions to read and write time series data. It uses the HTTP protocol to communicate with your **KairosDB** cluster.

Getting Started
---------------

[](#getting-started)

### Install (Composer)

[](#install-composer)

```
$ composer require 'danibrutal/kairosdb-client:dev-master'
```

### Connecting To Your Database

[](#connecting-to-your-database)

Connecting to an **KairosDB** database is straightforward. You will need a host name a port. The default port is 8080.

For more information please check out the [KairosDB Docs](http://kairosdb.github.io/kairosdocs/index.html).

### Inserting Data

[](#inserting-data)

We can add a single data point:

```
require 'vendor/autoload.php';

$client = new KairosDB\Client('localhost', 8090);
$tags = ['host'=> 'precise64'];
$metricName = 'network_out';

for($i=2; $iaddDataPoint($metricName, $dataPointValue, $tags);
    usleep(100);
}
```

Or using batch inserts:

```
require 'vendor/autoload.php';

$client = new \KairosDB\Client('localhost', 8090);
$tags = ['host'=> 'precise64'];
$metricName = 'network_out';

$dataPointCollection = new \KairosDB\DataPointCollection($metricName, $tags);

for($i=2; $iaddPoint($dataPointValue);
    usleep(100);
}

$client->addDataPoints($dataPointCollection);
```

Querying Data Points
--------------------

[](#querying-data-points)

The start date is required, but the end date defaults to NOW if not specified. The metric(s) that you are querying for is also required. Optionally, tags may be added to narrow down the search.

```
require 'vendor/autoload.php';

$client = new KairosDB\Client('localhost', 8090);

$queryBuilder = new \KairosDB\QueryBuilder();
$tags = ['host'=> 'precise64'];

$query = $queryBuilder
    ->start(['value'=> '1', 'unit' => 'days'])
    ->cache(10)
    ->addMetric('network_in')
    ->tags($tags)
    ->build();

$results = $client->query($query);
```

Querying Metric Names
---------------------

[](#querying-metric-names)

You can get a list of all metric names in KairosDB.

```
require 'vendor/autoload.php';

$client = new KairosDB\Client('localhost', 8090);

$results = $client->getMetricNames($query);
```

Querying Tag Names
------------------

[](#querying-tag-names)

Similarly you can get a list of all tag names in KairosDB.

```
require 'vendor/autoload.php';

$client = new KairosDB\Client('localhost', 8090);

$results = $client->getTagNames($query);
```

Querying Tag Values
-------------------

[](#querying-tag-values)

And a list of all tag values.

```
require 'vendor/autoload.php';

$client = new KairosDB\Client('localhost', 8090);

$results = $client->getTagValues($query);
```

Custom Data Types
-----------------

[](#custom-data-types)

TODO: implement

KairosDB Docs
-------------

[](#kairosdb-docs)

Please refer to for documentation.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/34d966e4ed290d9950b818498a4c51b0476d517d7a3f2cd03eee8ef8457a29de?d=identicon)[danibrutal](/maintainers/danibrutal)

---

Top Contributors

[![danibrutal](https://avatars.githubusercontent.com/u/684319?v=4)](https://github.com/danibrutal "danibrutal (8 commits)")

### Embed Badge

![Health badge](/badges/danibrutal-kairosdb-client/health.svg)

```
[![Health](https://phpackages.com/badges/danibrutal-kairosdb-client/health.svg)](https://phpackages.com/packages/danibrutal-kairosdb-client)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
