Merge ~woutervb/charm-graylog:master into ~graylog-charmers/charm-graylog:master

Proposed by Wouter van Bommel
Status: Superseded
Proposed branch: ~woutervb/charm-graylog:master
Merge into: ~graylog-charmers/charm-graylog:master
Diff against target: 22 lines (+3/-1)
1 file modified
files/check_graylog_health.py (+3/-1)
Reviewer Review Type Date Requested Status
Joe Guo (community) Approve
Junien F Disapprove
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+367556@code.launchpad.net

This proposal has been superseded by a proposal from 2019-06-12.

Commit message

Make an option to specify the lag-time

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

How would a charm operator use this option and/or be aware of it?

review: Needs Information
~woutervb/charm-graylog:master updated
9db4255... by Wouter van Bommel

Implemented the option indexer_failure_lag_hours

Via the charm config option: indexer_failure_lag_hours it possible to
specify how long back the python check should go when determining
indexer failures.
Defaults to 1 hour

Revision history for this message
Junien F (axino) wrote :

Just wanted to say that I'm +1 on the change from 1 day to 1 hour.

Revision history for this message
Tom Haddon (mthaddon) wrote :

Looks good, but please fix the lint error before landing.

review: Approve
~woutervb/charm-graylog:master updated
75e5778... by Wouter van Bommel

Fix linting

Revision history for this message
Junien F (axino) wrote :

For the record, I don't agree that this should be a config option.

review: Disapprove
~woutervb/charm-graylog:master updated
7907ba4... by Wouter van Bommel

Opinionate the charm

With this commit we force to look back for only 1 hour, when it comes to
index failures, and not the 24 hours like it was before

Revision history for this message
Joe Guo (guoqiao) wrote :

The current change is pretty simple now, looks good to me.

review: Approve

Unmerged commits

7907ba4... by Wouter van Bommel

Opinionate the charm

With this commit we force to look back for only 1 hour, when it comes to
index failures, and not the 24 hours like it was before

75e5778... by Wouter van Bommel

Fix linting

9db4255... by Wouter van Bommel

Implemented the option indexer_failure_lag_hours

Via the charm config option: indexer_failure_lag_hours it possible to
specify how long back the python check should go when determining
indexer failures.
Defaults to 1 hour

49adcee... by Wouter van Bommel

Make an option to specify the lag-time

By making the default time we look back for the index_failures a
parameter, defaulting to 1 hour, fixed indexing errors will be resolved
quicker by the service check.

It is a new option called --lag-time, specifying the look-back period in
hours, defaulting 1.

This will fix LP:1829467

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/check_graylog_health.py b/files/check_graylog_health.py
2index 7fde420..ba780af 100755
3--- a/files/check_graylog_health.py
4+++ b/files/check_graylog_health.py
5@@ -25,6 +25,7 @@ STATE_UNKNOWN = 3
6
7 OVERALL_STATE = STATE_OK
8
9+INDEX_LAG_HOURS = 1 # The amount of time we look back for indexing errors
10
11 def try_check(name, gapi_con, args, output):
12 global OVERALL_STATE
13@@ -86,7 +87,8 @@ def outstanding_notifications(gapi_con, args):
14
15
16 def indexer_failures(gapi_con, args):
17- since = datetime.datetime.utcnow() - datetime.timedelta(days=1)
18+ since = datetime.datetime.utcnow() - \
19+ datetime.timedelta(hours=INDEX_LAG_HOURS)
20 failures = gapi_con.indexer_failures_count(since.isoformat())['count']
21 msg = 'Indexer failures: {}'.format(failures)
22 if failures == 0:

Subscribers

People subscribed via source and target branches