-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add detailed_index_stats parameter to pull index-level metrics #10766
Changes from 3 commits
bd4fcd5
09e900d
a617583
0ffcd75
e2a5f12
3b828c9
0a78387
d95ea66
12c4a9c
ba00154
fbfba82
580e516
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ def test_from_instance_defaults(): | |
assert c.pshard_stats is False | ||
assert c.pshard_graceful_to is False | ||
assert c.cluster_stats is False | ||
assert c.detailed_index_stats is False | ||
assert c.index_stats is False | ||
assert c.service_check_tags == ['host:example.com', 'port:None'] | ||
assert c.tags == ['url:http://example.com'] | ||
|
@@ -38,18 +39,26 @@ def test_from_instance_cluster_stats(): | |
assert c.cluster_stats is True | ||
|
||
|
||
@pytest.mark.unit | ||
def test_from_instance_detailed_index_stats(): | ||
c = from_instance({'url': 'http://example.com', 'detailed_index_stats': True}) | ||
assert c.detailed_index_stats is True | ||
|
||
|
||
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. Can you also add a test for running the check when this parameter is enabled, and assert the expected tags? 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. @sarah-witt thanks and I addressed this comment in commit 0ffcd75 |
||
@pytest.mark.unit | ||
def test_from_instance(): | ||
instance = { | ||
"username": "user", | ||
"password": "pass", | ||
"is_external": "yes", | ||
"detailed_index_stats": "yes", | ||
"url": "http://foo.bar", | ||
"tags": ["a", "b:c"], | ||
} | ||
c = from_instance(instance) | ||
assert c.admin_forwarder is False | ||
assert c.cluster_stats is True | ||
assert c.detailed_index_stats is True | ||
assert c.url == "http://foo.bar" | ||
assert c.tags == ["url:http://foo.bar", "a", "b:c"] | ||
assert c.service_check_tags == ["host:foo.bar", "port:None", "a", "b:c"] | ||
|
@@ -73,6 +82,7 @@ def test_from_instance(): | |
c = from_instance(instance) | ||
assert c.admin_forwarder is True | ||
assert c.cluster_stats is False | ||
assert c.detailed_index_stats is False | ||
assert c.url == "https://foo.bar:9200" | ||
assert c.tags == ["url:https://foo.bar:9200"] | ||
assert c.service_check_tags == ["host:foo.bar", "port:9200"] |
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.
Can you add some unit tests for process_metric since the behavior is changing?
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 added the creation of an index that starts with a dot "
.
" and added a check for this new index totest_index_metrics
and the new test I created calledtest_detailed_index_stats
in commit 0ffcd75