mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
Fixed metric latency unit and logging (#49)
* move latency_unit into cachet dictionary * log actual metric latency_unit * also update config in readme * also update config description in readme
This commit is contained in:
@@ -37,8 +37,8 @@ cachet:
|
|||||||
- CREATE_INCIDENT
|
- CREATE_INCIDENT
|
||||||
- UPDATE_STATUS
|
- UPDATE_STATUS
|
||||||
public_incidents: true
|
public_incidents: true
|
||||||
|
latency_unit: ms
|
||||||
frequency: 30
|
frequency: 30
|
||||||
latency_unit: ms
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **endpoint**, the configuration about the URL that will be monitored.
|
- **endpoint**, the configuration about the URL that will be monitored.
|
||||||
@@ -59,8 +59,8 @@ latency_unit: ms
|
|||||||
- **CREATE_INCIDENT**, we will create an incident when the expectation fails.
|
- **CREATE_INCIDENT**, we will create an incident when the expectation fails.
|
||||||
- **UPDATE_STATUS**, updates the component status
|
- **UPDATE_STATUS**, updates the component status
|
||||||
- **public_incidents**, boolean to decide if created incidents should be visible to everyone or only to logged in users. Important only if `CREATE_INCIDENT` or `UPDATE_STATUS` are set.
|
- **public_incidents**, boolean to decide if created incidents should be visible to everyone or only to logged in users. Important only if `CREATE_INCIDENT` or `UPDATE_STATUS` are set.
|
||||||
|
- **latency_unit**, the latency unit used when reporting the metrics. It will automatically convert to the specified unit. It's not mandatory and it will default to **seconds**. Available units: `ms`, `s`, `m`, `h`.
|
||||||
- **frequency**, how often we'll send a request to the given URL. The unit is in seconds.
|
- **frequency**, how often we'll send a request to the given URL. The unit is in seconds.
|
||||||
- **latency_unit**, the latency unit used when reporting the metrics. It will automatically convert to the specified unit. It's not mandatory and it will default to **seconds**. Available units: `ms`, `s`, `m`, `h`.
|
|
||||||
|
|
||||||
## Setting up
|
## Setting up
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ class Configuration(object):
|
|||||||
|
|
||||||
if metrics_request.ok:
|
if metrics_request.ok:
|
||||||
# Successful metrics upload
|
# Successful metrics upload
|
||||||
self.logger.info('Metric uploaded: %.6f seconds' % (value,))
|
self.logger.info('Metric uploaded: %.6f %s' % (value, self.latency_unit))
|
||||||
else:
|
else:
|
||||||
self.logger.warning('Metric upload failed with status [%d]' %
|
self.logger.warning('Metric upload failed with status [%d]' %
|
||||||
(metrics_request.status_code,))
|
(metrics_request.status_code,))
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ cachet:
|
|||||||
- CREATE_INCIDENT
|
- CREATE_INCIDENT
|
||||||
- UPDATE_STATUS
|
- UPDATE_STATUS
|
||||||
public_incidents: true
|
public_incidents: true
|
||||||
|
latency_unit: ms
|
||||||
frequency: 30
|
frequency: 30
|
||||||
latency_unit: ms
|
|
||||||
|
|||||||
Reference in New Issue
Block a user