Download the PHP package extraswoft/prometheus-exporter without Composer

On this page you can find all versions of the php package extraswoft/prometheus-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package prometheus-exporter

简介

本项目基于github上的swoft开源项目进行组件开发,扩展了一个prometheusExporter sdk组件, prometheus 是一个开源的系统监控和告警平台,通过Exporter即可快速地生成prometheus需要的记录信息, 通过中间件和注解来对监控数据非侵入式注入。

目前新增prometheus 是否持久化的选项

环境强制要求

  1. 根据swoft官方要求即可

配置步骤

1.加载包

2.在base.php文件的middlewares里加入middleware

注意:加入该中间件是对所有请求进行的基本监控,包括持久化。

3.在app.php文件的bootScan和beanScan加入bean需要扫描的命名空间

4.在.env配置文件中添加以下配置

PROMETHEUSEXPORTER_REDIS_PREFIX,持久化到redis的命名前缀
PROMETHEUSEXPORTER_PUSHGATEWAY_HOST, 若采用pushGateway,它的地址
PROMETHEUSEXPORTER_INSTANCE, 实例名,可以配置,也可以用主机名,适合多实例
PROMETHEUSEXPORTER_COUNTER_LINE,swoole table 申请的行数,下两个同理,若为0则不创建table
PROMETHEUSEXPORTER_GAUGE_LINE,
PROMETHEUSEXPORTER_HISTOGRAM_LINE,histogram需要的行数要较其他的较多,建议配置多点
PROMETHEUSEXPORTER_PERSISTENCE,prometheus 是否从redis获取持久化数据

日常使用

1.注解使用(只支持方法)

注意,若想在Controller里的方法使用(普通的bean可以不关心),需要同时给Controller添加注解,比如:

2.方法调用

持久化

1.注解,给某个方法或接口加上缓存注解,调用即可,灵活方便(推荐)

2.自行使用方法

使用pushGateway

获取prometheus文本

具体可参照下面例子

效果图

![image]()

注意事项

问题

1.prometheus怎么用,好用不,搭配grafana怎么用?

答:好用,看完这本你都会了,prometheus实战


All versions of prometheus-exporter with dependencies

PHP Build Version
Package Version
Requires swoft/http-message Version *
swoft/framework Version *
swoft/http-client Version *
doctrine/annotations Version ^1.4
swoft/redis Version *
swoft/memory Version *
swoft/http-server Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package extraswoft/prometheus-exporter contains the following files

Loading the files please wait ....