48 Commits

Author SHA1 Message Date
mtakaki
5679bdaa52 83 (#84)
* #83 - Fixing the bug that was preventing the status update

* #83 - Refactoring unit tests for configuration to ensure we catch more cases
2020-02-10 23:51:02 -08:00
Christian Strobel
bd610671fa Added os import (#82) 2020-01-29 02:02:06 -08:00
mtakaki
df2d094dc6 Fixing push status that has been broken since moving to a client (#80)
* Fixing push status that has been broken since moving to a client

* Adding unit test to cover the bug
2020-01-28 01:42:49 -08:00
mtakaki
5be0217c00 #10 - Creating auxiliary client class to generate configuration class (#78)
* #10 - Creating auxiliary client class to generate configuration class based on cachet's component list.

* Updating the python version in codacy to reduce false positives

* Moving some of the cachet operations to the client class to clean up the configuration class and making better constants

* Refactoring status to have proper classes and adding more tests. Refactoring the requests tests to use requests-mock.

* Removing unused imports from test_scheduler

* Adding more tests and the ability to run the client from command line

* Updating README and client arg parsing

* Fixing broken unit tests
2020-01-18 13:55:07 -08:00
mtakaki
bcafbd64f7 21 2 (#77)
* 21 - Improving exception when an invalid type is used in the config

* Bumping the version
2020-01-06 07:40:11 -08:00
mtakaki
a13a42d51c Multithreading #66 (#76)
* feat(multihreading): each url has it's own thread

* Fixing broken unit tests

* Improving readability when there are multiple URLs registerd and creating new action to upload metrics

* Improving error message when there's no file found

* Bumping the version

Co-authored-by: Alex Berenshtein <aberenshtein@yotpo.com>
2020-01-05 10:25:06 -08:00
Mitsuo Takaki
e132f8660b #72 - Adding the ability to control incident status 2019-10-25 08:10:12 -07:00
Mitsuo Takaki
9e5d42f8b8 Fixing broken build, due to updates to the libraries 2019-10-24 21:31:04 -07:00
mazhead
a296cfc1aa Dont update if same (#64)
* Return status as integer

During the first start the if statement on line 237 does not get evaluated correctly and will not "return"
Therefore by any restart the first evaluation triggers a update even if the original status is same.

* Prevent unecessery push

By a case where allowed_fails > 0 and one failure is received the url monitor pushes a unnecessary update as the component state was not changed, resulting in a notification of "component is operational", but in fact the component was still operation before the update.

This creates another api call (get) towards the cachet, but it is a better trade-off to prevent unnecessary notifications for end-users.
2019-04-04 08:44:34 -07:00
mazhead
9569818bb0 Return status as integer (#63)
During the first start the if statement on line 237 does not get evaluated correctly and will not "return"
Therefore by any restart the first evaluation triggers a update even if the original status is same.
2019-04-04 08:39:25 -07:00
mazhead
3af53ce9b6 Add client header option to requests (#61)
* Add header option

* Add header option

* Add unit test for headers

* Add client header

* Remove environ for HEADER

environ does not support dictionaries, so HEADER can't be passed.
2019-03-31 01:18:48 -07:00
Patrick Fruh
f1e69bf39b 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
2019-02-24 21:59:02 -08:00
mtakaki
10e0141454 Upgrading to python3 (#60)
* Migrating to python 3.7.2, but docker image is not working properly.

Need to continue investigating why it's not properly running.

* Trying to fix the build and fixing logging in the scheduler initialization.

* Trying to fix the build

* Collecting test results

* Fixing the dockerfile

* Updating the development dependencies
2019-02-22 02:17:13 -08:00
mtakaki
1f1bab6398 Merge branch 'master' into dont_push_status 2018-03-20 00:20:33 -07:00
mtakaki
57fc100d49 Merge branch 'master' into allowed_fails 2018-03-19 23:38:52 -07:00
Mitsuo Takaki
4c336ec714 Running some manual tests and updating Dockerfile 2018-03-18 22:17:29 -07:00
Mitsuo Takaki
d3c14e6491 Addressing codacy issues 2018-03-18 17:44:01 -07:00
Mitsuo Takaki
1899e95642 #38 - Adding support to milliseconds and different units for latency and changing http status to a range, instead of a single value. 2018-03-18 16:58:02 -07:00
mtakaki
5e5e74938b Merge branch 'master' into dont_push_status 2017-05-30 22:28:37 -07:00
mtakaki
350d125d26 Merge branch 'master' into allowed_fails 2017-03-12 11:57:32 -07:00
Jacek Szubert
0b1e83eae1 Create incident/update component status only after specified amount of failed connection trials 2017-03-12 19:51:25 +11:00
mtakaki
8ce89e452f Merge pull request #34 from jacekszubert/default_metric
Push default metric value for failed connection trials
2017-03-11 18:56:08 -08:00
Jacek Szubert
22d032308f Better url scheme handling 2017-03-11 18:58:11 +11:00
Jacek Szubert
da7568300e Update component status only when it has changed 2017-03-09 18:25:45 +11:00
Jacek Szubert
fd0cca2060 Push default metric value for failed connection trials 2017-03-09 13:35:05 +11:00
Jacek Szubert
ab9957761c Use http as a default schema 2017-03-08 16:55:55 +11:00
mtakaki
c36e42ea11 Merge branch 'master' into remove_unused_functs 2017-03-06 01:11:04 -08:00
Jacek Szubert
cf43e568b1 Remove unused functions 2017-03-06 15:17:49 +11:00
Jacek Szubert
f7381aa2bc Added configuration for incident visibility 2017-03-03 16:26:58 +11:00
Mitsuo Takaki
cb5137c526 Fixing default list parameter 2017-02-11 01:15:09 -08:00
Mitsuo Takaki
3830063ba4 Renaming Agent classes to decorators to comply with the design pattern 2017-02-11 01:09:12 -08:00
Mitsuo Takaki
e8d4b88c79 Changing the actions to enum list so it's more flexible. 2017-02-11 01:02:27 -08:00
Jacek Szubert
740f726b48 Make update status optional 2017-02-10 14:50:07 +11:00
Mitsuo Takaki
c59126fd0f Exposing the configuration to avoid the current parsing problems. #20 2017-01-20 00:58:55 -08:00
RAHUL GOEL
969a2b1580 Correction in Import statement of configuration.py
In current version of code status file was being imported as cachet_url_monitor.status while configuration.py and status.py being kept in same folder.
Hence replaced imported statement as import status as st.
2016-06-24 22:16:24 +05:30
Mitsuo Takaki
d63420ac01 Documenting better the code and small tweaks to the unit tests. 2016-05-20 02:23:39 -07:00
Mitsuo Takaki
a3a91edadc Adding support to overriding some of the configuration through environment variables. 2016-05-19 23:41:20 -07:00
Mitsuo Takaki
ca358eab2b Verifying component status when we initialize to set the initial state. Tests are failing, but checking it in nonetheless. 2016-05-18 09:34:58 -07:00
Mitsuo Takaki
0f53ff8678 Initial attempt at creating incidents when an URL becomes unhealthy. Missing to actually call it from the scheduler. #3 2016-05-16 01:31:53 -07:00
Mitsuo Takaki
6f70206603 Improving the validation to show all missing keys. 2016-05-03 23:37:36 -07:00
Mitsuo Takaki
d7bf54fa0a Validating the configuration file and improving the initial output with the expectations. 2016-05-03 22:41:48 -07:00
Mitsuo Takaki
f563526a2a Creating push_metrics() method to start pushing the URL latency, if it the metric id is configured. 2016-05-03 02:28:58 -07:00
Mitsuo Takaki
072aed1024 Adding better documentation and more tests, but still missing tests for Scheduler 2016-05-01 00:41:33 -07:00
Mitsuo Takaki
f254bddd0f Fixing log format and extracting main logic to a separate class. 2016-04-30 13:39:02 -07:00
Mitsuo Takaki
c5520450ba Adding new expectation (Regex) and creating unit tests. 2016-04-29 08:48:53 -07:00
Mitsuo Takaki
2f3106da60 Creating agent that schedules the monitoring task. 2016-04-28 01:51:59 -07:00
Mitsuo Takaki
4c8cbc6d67 Changing approach to update component status, but still missing push metrics. 2016-04-28 01:10:19 -07:00
Mitsuo Takaki
37bec316ff Initial implementation but taking a different approach. 2016-04-27 21:45:24 -07:00