PHPackages                             butschster/prometheus-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. butschster/prometheus-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

butschster/prometheus-parser
============================

Prometheus parser written on PHP 8

1.0.1(3y ago)102313[3 issues](https://github.com/butschster/prometheus-parser/issues)MITPHPPHP &gt;=8.1

Since Nov 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/butschster/prometheus-parser)[ Packagist](https://packagist.org/packages/butschster/prometheus-parser)[ RSS](/packages/butschster-prometheus-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Prometheus metrics parser for PHP
=================================

[](#prometheus-metrics-parser-for-php)

[![PHP Version Require](https://camo.githubusercontent.com/71fb4b6f4795228e46f0fab45ebf3860892bc07afbdbd7b6aae1540b387623cb/68747470733a2f2f706f7365722e707567782e6f72672f627574736368737465722f70726f6d6574686575732d7061727365722f726571756972652f706870)](https://packagist.org/packages/butschster/prometheus-parser)[![Latest Stable Version](https://camo.githubusercontent.com/05992364cb583f53c6c48b4d82016757d3629b44216853e489dd5edbe9f4e7cf/68747470733a2f2f706f7365722e707567782e6f72672f627574736368737465722f70726f6d6574686575732d7061727365722f762f737461626c65)](https://packagist.org/packages/butschster/prometheus-parser)[![phpunit](https://github.com/butschster/prometheus-parser/actions/workflows/phpunit.yml/badge.svg)](https://github.com/butschster/prometheus-parser/actions)[![psalm](https://github.com/butschster/prometheus-parser/actions/workflows/psalm.yml/badge.svg)](https://github.com/butschster/prometheus-parser/actions)[![Total Downloads](https://camo.githubusercontent.com/a3049ef38400b1162df3c28e1355b792a8b781159e88167c562d6b35f05d58d8/68747470733a2f2f706f7365722e707567782e6f72672f627574736368737465722f70726f6d6574686575732d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/butschster/prometheus-parser)

[![Github cover Prometheus parser](https://user-images.githubusercontent.com/773481/199663705-3540ce54-086e-476e-bf91-cd607c98df9f.jpg)](https://user-images.githubusercontent.com/773481/199663705-3540ce54-086e-476e-bf91-cd607c98df9f.jpg)

Welcome to the Prometheus Metrics Parser! This package makes it easy to extract valuable information from metrics in the Prometheus text-based format. Whether you're looking to analyze your metrics data, integrate it into other systems, or just want a better way to visualize it, this package has you covered.

With just a few lines of code, you can easily extract valuable insights from your Prometheus metrics.

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

[](#requirements)

- PHP 8.1 and above

Quick start
-----------

[](#quick-start)

To install the package, run the following command from the root directory of your project:

```
composer require butschster/prometheus-parser
```

That's it!

Usage
-----

[](#usage)

To get started, simply pass a string containing your Prometheus metric data to the `parse()` method. The method will return a schema object with metric objects, each of which contains the following properties:

```
use Butschster\Prometheus\ParserFactory;

$parser = ParserFactory::create();

$schema = $parser->parse(getMetrics(); // array of Metric

$metrics['http_requests_total']->description; // The total number of HTTP requests.
$metrics['http_requests_total']->type; // counter
$metrics['http_requests_total']->name; // http_requests_total

foreach ($metrics['go_gc_duration_seconds'] as $metric) {
    $metric->name; // go_gc_duration_seconds
    $metric->value; // Value
    $metric->timestamp; // Timestamp
    $metric->lables; // Array of labels
}
```

Enjoy!
======

[](#enjoy)

---

License
-------

[](#license)

The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1284d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/773481?v=4)[Pavel Buchnev](/maintainers/butschster)[@butschster](https://github.com/butschster)

---

Top Contributors

[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (11 commits)")

---

Tags

parserphpphp8prometheusphpphp8prometheusddlprometheus-parser

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/butschster-prometheus-parser/health.svg)

```
[![Health](https://phpackages.com/badges/butschster-prometheus-parser/health.svg)](https://phpackages.com/packages/butschster-prometheus-parser)
```

###  Alternatives

[nikic/phlexy

Lexing experiments in PHP

162570.9k13](/packages/nikic-phlexy)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23483.5k2](/packages/corveda-php-sandbox)[butschster/dbml-parser

DBML (database markup language) parser written on PHP8.

6416.8k2](/packages/butschster-dbml-parser)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[bupy7/xml-constructor

The array-like constructor of XML document structure.

1337.9k](/packages/bupy7-xml-constructor)

PHPackages © 2026

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