krenor/prometheus-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

krenor/prometheus-client

Composer 安装命令:

composer require krenor/prometheus-client

包简介

A PHP Client for Prometheus

README 文档

README

Monitor your PHP applications using Prometheus.

icon-version icon-php icon-build
icon-code-quality icon-code-coverage icon-license

Features

  • Support for Counters, Gauges, Histograms, Summaries and custom metrics
  • Various storage repositories
  • Easy usage in style of Laravels Eloquent ORM
  • Initialization of Metrics without labels
  • Support of float values
  • Push Gateway
  • State exporters (for fpm_get_status() or opcache_get_status())

Planned features

  • PHP 7.4 rewrite
  • Laravel integration

Project State

This library is currently under development.

As long as it's not tagged in a >= 1.* version I could commit incompatible changes!

Quickstart

<?php

use Krenor\Prometheus\Metrics\Metric;
use Krenor\Prometheus\Metrics\Counter;
use Krenor\Prometheus\CollectorRegistry;
use Krenor\Prometheus\Renderer\TextRenderer;
use Krenor\Prometheus\Storage\StorageManager;
use Krenor\Prometheus\Storage\Repositories\InMemoryRepository;
use Krenor\Prometheus\Tests\Stubs\MultipleLabelsCounterStub as ExampleCounter;

Metric::storeUsing(new StorageManager(new InMemoryRepository));

$registry = new CollectorRegistry;

$counter = $registry->register(new ExampleCounter);

$counter->increment(['some', 'label', 'values']);
$counter->incrementBy(3, ['foo', 'bar', 'baz']);

$samples = $registry->collect();
$metrics = (new TextRenderer)->render($samples);

A more detailed documentation can be found here.

Note: Since this project is in the works, some parts may lack documentation.
You can orient yourself on the tests if something's unclear.

Contributing

Please see CONTRIBUTING for more information.

Licence

The MIT License. Please see LICENSE for more information.

统计信息

  • 总下载量: 21.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固