-
Notifications
You must be signed in to change notification settings - Fork 813
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
[auto-discovery] re-pipe configurations after JMXFetch restart #3415
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8aa516c
[auto-discovery][jmx] a jmxfetch restart should prompt AD check reload.
truthbk ecfac97
[auto-discovery][jmx] handle missing launch file exception
truthbk fd650c5
[auto-discovery][jmxfetch] use modify time instead.
truthbk 6840937
[auto-discovery][jmx] refactor to handle re-submissions in a cleaner …
truthbk 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
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 |
---|---|---|
|
@@ -70,6 +70,8 @@ | |
'list_limited_attributes': "List attributes that do match one of your instances configuration but that are not being collected because it would exceed the number of metrics that can be collected", | ||
JMX_COLLECT_COMMAND: "Start the collection of metrics based on your current configuration and display them in the console"} | ||
|
||
JMX_LAUNCH_FILE = 'jmx.launch' | ||
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. maybe it should be a hidden file. 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. since it's in jmxfetch's temp directory I'd say a regular file is okay |
||
|
||
LINK_TO_DOC = "See http://docs.datadoghq.com/integrations/java/ for more information" | ||
|
||
|
||
|
@@ -336,6 +338,16 @@ def _start(self, path_to_java, java_run_opts, jmx_checks, command, reporter, too | |
log.exception("Couldn't launch JMXFetch") | ||
raise | ||
|
||
@staticmethod | ||
def _get_jmx_launchtime(): | ||
fpath = os.path.join(get_jmx_pipe_path(), JMX_LAUNCH_FILE) | ||
try: | ||
_stat = os.stat(fpath) | ||
except OSError as e: | ||
raise e | ||
|
||
return _stat.st_mtime | ||
|
||
@staticmethod | ||
def _is_jmx_check(check_config, check_name, checks_list): | ||
init_config = check_config.get('init_config', {}) or {} | ||
|
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.
I'm not sure this jmxfetch-specific code block should be here exactly:
JMXFetch
restarts aren't really related to the updates in the config template store (which is what the parent block is about).On top of that, when JMXFetch restarts, it'd be nice to reload only the jmx-related check configs instead of all the check configs.
So:
if
block (i.e. right afterself.reload_configs_flag = False
)?self.sd_backend.reload_check_configs = True
Let me know how that sounds to you, I might have missed something.