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 11y 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 today

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 35% 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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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