Skip to content

Commit

Permalink
Add level setting
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Dec 24, 2024
1 parent 6341365 commit b1bd44b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ __pycache__
*.iml
.idea

imalive.yml

# Eclipse Core
.project

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ monitors:
timeout: 30 # optional (30 seconds if not present)
username: changeit # optional (no basic auth if not present)
password: changeit # optional (no basic auth if not present)
level: INFO # optional, log level if monitor is healthy (DEBUG by default)
headers: # optional (no headers if empty)
- name: Accept
value: application/json
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.18
4.0.19
3 changes: 2 additions & 1 deletion src/utils/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def check_http_monitor(monitor, gauges):
expected_contain = get_or_else(monitor, 'expected_contain', None)
body = get_or_else(monitor, 'body', None)
check_tls = is_true(get_or_else(monitor, 'check_tls', True))
level = get_or_else(monitor, 'level', 'DEBUG')
duration = None
auth = None
headers = {}
Expand Down Expand Up @@ -118,7 +119,7 @@ def check_http_monitor(monitor, gauges):
return

set_gauge(gauges['result'], 1, {**labels, 'kind': 'result'})
log_msg("DEBUG", {
log_msg(level, {
"status": "ok",
"type": "monitor",
"time": vdate.isoformat(),
Expand Down

0 comments on commit b1bd44b

Please sign in to comment.