basilicom / koality-bundle
此Pimcore插件包可用于将指标发送到koality.io
v1.0.2
2021-05-04 12:32 UTC
Requires
- ext-json: *
- leankoala/healthfoundation: dev-master
This package is auto-updated.
Last update: 2024-09-19 23:55:38 UTC
README
一般信息
此Pimcore插件包提供了两个不同的端点(一个用于业务指标,一个用于服务器指标)用于https://www.koality.io/de的健康检查监控服务。请参阅指标部分以获取提供的指标的详细概述。
用法
composer require basilicom/koality-bundle
确保在AppKernel中注册此插件包,例如:
public function registerBundlesToCollection(BundleCollection $collection) {
$collection->addBundle(new \Basilicom\KoalityBundle\KoalityBundle());
}
插件的工作方式
安装后,插件将在以下端点提供JSON格式的数据:
yourdomain.tu/pimcore-koality-bundle-business
yourdomain.tu/pimcore-koality-bundle-server
用于业务或服务器指标。
如果您已设置密钥令牌,则端点将如下所示:
yourdomain.tu/pimcore-koality-bundle-business?token=mySecret
yourdomain.tu/pimcore-koality-bundle-server?token=mySecret
配置
将以下配置部分添加到您的config.yaml中:
koality:
token:
secret: 'mySecret'
orders_per_time_interval_check:
enable: true
hours: 24
threshold: 1000
new_carts_per_time_interval_check:
enable: true
hours: 1
debug_mode_enabled_check:
enable: true
maintenance_worker_running_check:
enable: true
server_uptime_check:
enable: true
time_interval: '7 years'
space_used_check:
enable: true
limit_in_percent: 80
path_to_container: '/some/path/'
container_is_running_check:
enable: true
container_name: 'test container name'
示例JSON输出
{
"status": "fail",
"output": "The health check failed.",
"checks": {
"orders_per_time_interval": {
"status": "fail",
"output": "Count of orders during the specified time interval is below threshold of: 1000",
"description": "Shows count of orders during the last 24 hour(s)",
"observedValue": 0,
"observedUnit": "Orders",
"metricType": "time_series_numeric",
"observedValuePrecision": 2
},
"debug_mode_enabled_check": {
"status": "fail",
"output": "Debug mode is ON",
"description": "Indicates whether debug mode is enabled.",
"observedValue": 0,
"metricType": "time_series_percent",
"observedUnit": "percent"
},
"maintenance_worker_running_check": {
"status": "fail",
"output": "Maintenance Job wasn't executed within the last hour",
"description": "Indicates whether maintenance jobs where running within last hour",
"observedValue": 0,
"metricType": "time_series_percent",
"observedUnit": "percent"
},
...
}
}
指标
以下指标已实现:
服务器指标
- SpaceUsedCheck - 如果设备上剩余的空间低于定义的限制,则此检查失败。
- UptimeCheck - 如果超过定义的运行时间(默认为1年),则此检查失败。
- ContainerIsRunningCheck - 如果定义的容器没有运行,则此检查失败。
业务(Pimcore)指标
- OrdersPerTimeIntervalCheck - 此检查测量一定时间间隔内新订单的数量。如果没有达到提供的阈值,则将失败。
- NewCartsPerTimeIntervalCheck - 此检查测量一定时间间隔内新购物车的数量。
- MaintenanceWorkerRunningCheck - 此检查提供有关过去一小时内维护作业是否已完成的详细信息。
- DebugModeEnabledCheck - 此检查指示是否启用了调试模式。
待办事项
添加更多Pimcore电子商务特定指标,例如
- 活动产品最少数量(用于检测导入失败)
- 检查Pimcore更新
- 指定时间段的登录尝试次数
- tbc.