-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tristan/agent checks ui #922
Merged
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5e38fee
Add agent_checks to metadata sent
tmichelet 306ec2f
Add agent checks errors to metadata
tmichelet 8d13905
send checks for all instances
tmichelet 37e2da8
Add source_type_name to checks, default is file name
tmichelet 0466de9
override checks source_type_name when needed
tmichelet 335769f
Update system checks source_type_name + fix typo
tmichelet f05d1aa
resolve merging conflicts
tmichelet e14b026
make checks fail
tmichelet f5414f4
Remove useless SOURCE_TYPE_ID
tmichelet bbfa0be
Update variable name
tmichelet 9ccf9e3
Revert "make checks fail"
tmichelet cc3c32e
Fix typo
tmichelet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,14 @@ def run(self, checksd=None, start_event=True): | |
payload['metrics'] = metrics | ||
payload['events'] = events | ||
payload['service_checks'] = service_checks | ||
|
||
# Add agent_chekcs if needed | ||
if self._should_send_metadata(): | ||
payload['agent_checks'] = [ | ||
(c.name, c.instance_statuses[0].status, c.instance_statuses[0].error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should probably send the statuses for all our instances and they we can decide how to display an error or not on the server side. Also, please fix the indent |
||
for c in check_statuses | ||
] | ||
|
||
collect_duration = timer.step() | ||
|
||
if self.os != 'windows': | ||
|
@@ -379,7 +387,7 @@ def _build_payload(self, start_event=True): | |
}] | ||
|
||
# Periodically send the host metadata. | ||
if self._is_first_run() or self._should_send_metadata(): | ||
if self._should_send_metadata(): | ||
payload['systemStats'] = get_system_stats() | ||
payload['meta'] = self._get_metadata() | ||
self.metadata_cache = payload['meta'] | ||
|
@@ -427,6 +435,8 @@ def _get_metadata(self): | |
return metadata | ||
|
||
def _should_send_metadata(self): | ||
if self._is_first_run(): | ||
return True | ||
# If the interval has passed, send the metadata again | ||
now = time.time() | ||
if now - self.metadata_start >= self.metadata_interval: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo