承接 orinokko/state-monitor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

orinokko/state-monitor

Composer 安装命令:

composer require orinokko/state-monitor

包简介

State Monitor

README 文档

README

Packagist build status

Collects data about exceptions, manual events and some logs. Supports writing to BigQuery. For further data analysis, you can use Google Data Studio or your own application.

For example: Errors

Installation

1. Require the Package

composer require orinokko/state-monitor

2. Add to .env

The service identifier of your application

STATE_MONITOR_APP=AppName

Whether or not to use mailing for errors

STATE_MONITOR_LOCAL_EMAIL=true
STATE_MONITOR_ALERT_EMAIL=mail@example.com

Whether or not to use BigQuery

STATE_MONITOR_BIGQUERY=true

Settings for BigQuery, more details

STATE_MONITOR_GOOGLE_CLOUD_PROJECT=[monitor-123456]
STATE_MONITOR_GOOGLE_APPLICATION_CREDENTIALS=[storage/monitor.json]

Whether or not to log queries

STATE_MONITOR_LOG_QUERIES=false

Enable or disable kernel middleware (default "true"-enabled)

STATE_MONITOR_MIDDLEWARE_WEB=false
STATE_MONITOR_MIDDLEWARE_API=false

3. Run config test and installation

php artisan monitor:install

You must get one of or both lines

Local email channel activated and recipient address provided.
BigQuery channel activated and connection settings provided.

In the process, additional actions will be performed:

  1. If sending by email is activated, a test letter will be sent to the specified address (using application mail settings).
  2. If saving in BigQuery is activated, the existence of the “monitor” data set will be checked. And it will be created if there is no such data set yet. Also the existence of tables "errors", "events", "checks", "queries" will be checked. If they are not there they will be created.

Example output after installation:

public_html$ php artisan monitor:install
Current settings:
STATE_MONITOR_APP=TestAppName
STATE_MONITOR_LOCAL_EMAIL=
STATE_MONITOR_ALERT_EMAIL=mail@example.com
STATE_MONITOR_BIGQUERY=1
STATE_MONITOR_GOOGLE_CLOUD_PROJECT=monitor
STATE_MONITOR_GOOGLE_APPLICATION_CREDENTIALS=/storage/monitor.json
STATE_MONITOR_LOG_QUERIES=1
STATE_MONITOR_MIDDLEWARE_WEB=
STATE_MONITOR_MIDDLEWARE_API=
Local email channel disabled.
BigQuery channel activated and connection settings provided. Try configure the database...
Dataset already exist.
Table for errors already exist.
Table for checks already exist.
Table for events already exist.
Table for queries already exist.

4. Publish assets

php artisan vendor:publish --provider='Orinoko\StateMonitor\MonitorServiceProvider' --tag='public' --force

Advices

If the site package is used in different applications

Ensure that real data is listed in APP_NAME and APP_URL. They are can be used to find the sender.

Usage

Exceptions monitoring

Exceptions automatically will be caught on web and api middleware groups. You can disable this middleware in .env file.

Also exist middleware for custom routes and other:

->middleware('state-monitor-errors')

Checks monitoring

Called manually

Monitor::validateRequest($type,$url,$method,$params=[],$user='',$domain='')

Events monitoring

Called manually

Monitor::storeEvent($message,$priority=0,$url='',$method='',$params=[],$user='',$domain='')

Database monitoring

If STATE_MONITOR_LOG_QUERIES is enabled, it will automatically log all queries to the appropriate table.

Front

After publishing assets add to html

<script src="/vendor/state-monitor/js/monitor.js"></script>

Calling

<script>
    if (typeof monitorAddEvent === "function")
        monitorAddEvent('Page http://phplaravel-135581-835906.cloudwaysapps.com loaded');
</script>

Contribution

Buy Me A Coffee

统计信息

  • 总下载量: 190
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 12
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-05-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固