PHPackages                             openmetrics-php/exposition-text - 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. openmetrics-php/exposition-text

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

openmetrics-php/exposition-text
===============================

Implementation of the text exposition format of OpenMetrics

v0.4.3(2mo ago)36508.9k↓26.6%116MITPHPPHP ^7.2 || ^8.0 || ^8.4CI failing

Since Nov 4Pushed 2mo ago2 watchersCompare

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

READMEChangelog (8)DependenciesVersions (11)Used By (6)

[![CI and release](https://github.com/openmetrics-php/exposition-text/actions/workflows/ci.yml/badge.svg)](https://github.com/openmetrics-php/exposition-text/actions/workflows/ci.yml)

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
- Histogram (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).

Supported PHP Versions
----------------------

[](#supported-php-versions)

- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5

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).

```
