PHPackages                             manticoresoftware/openmetrics - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. manticoresoftware/openmetrics

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

manticoresoftware/openmetrics
=============================

Implementation of the text exposition format of OpenMetrics

v0.1.0(3y ago)028.6k↓16%1MITPHPPHP &gt;=8.1

Since Oct 27Pushed 3y agoCompare

[ Source](https://github.com/manticoresoftware/exposition-text)[ Packagist](https://packagist.org/packages/manticoresoftware/openmetrics)[ RSS](/packages/manticoresoftware-openmetrics/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

[![CircleCI](https://camo.githubusercontent.com/5b34f64a55c39f22303ffd566d7517007baca360e58c96dfe429fa1543a9774b/68747470733a2f2f636972636c6563692e636f6d2f67682f6f70656e6d6574726963732d7068702f6578706f736974696f6e2d746578742e7376673f7374796c653d737667)](https://circleci.com/gh/openmetrics-php/exposition-text)[![Latest Stable Version](https://camo.githubusercontent.com/c000703b94df57567b0eeaf9cfaf2ac62a47f477438c3fdc4c2855b567710605/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e6d6574726963732d7068702f6578706f736974696f6e2d746578742f762f737461626c65)](https://packagist.org/packages/openmetrics-php/exposition-text)[![Total Downloads](https://camo.githubusercontent.com/29bfc6340e67a838f95ae49735c8358f89cc11a86065a11ce11fb0668e74310e/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e6d6574726963732d7068702f6578706f736974696f6e2d746578742f646f776e6c6f616473)](https://packagist.org/packages/openmetrics-php/exposition-text)[![codecov](https://camo.githubusercontent.com/44e2588edde2919a90b6fdad0a54abce13d51f289a9345b2dc26db6c103bc559/68747470733a2f2f636f6465636f762e696f2f67682f6f70656e6d6574726963732d7068702f6578706f736974696f6e2d746578742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/openmetrics-php/exposition-text)[![phpstan enabled](https://camo.githubusercontent.com/96cefcabfaf3777e8f933f973a7ea208f547fe88769e87f0579d1a83eea5e6b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d656e61626c65642d677265656e2e737667)](https://github.com/phpstan/phpstan)

OpenMetrics-PHP Exposition Text
===============================

[](#openmetrics-php-exposition-text)

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

[](#description)

Implementation of the text exposition format of [OpenMetrics](https://openmetrics.io).

This implementation supports the following metric types:

- Counter
- Gauge
- Historgram (calculated from a collection of gauges)
- Summary (calculated from a collection of gauges)

**Please note:** that the following content-type header is used for the HTTP response by default `Content-Type: application/openmetrics-text; charset=utf-8` as [discussed here](https://github.com/OpenObservability/OpenMetrics/issues/79).

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1

Installation
------------

[](#installation)

```
composer require openmetrics-php/exposition-text
```

Usage
-----

[](#usage)

### Create a collection of counters and respond it

[](#create-a-collection-of-counters-and-respond-it)

See [examples/counters.php](./examples/counters.php).

```
