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
Show executor metrics #1096
Show executor metrics #1096
Conversation
cli/dcoscli/metrics.py
Outdated
@@ -9,6 +9,11 @@ | |||
emitter = emitting.FlatEmitter() | |||
|
|||
|
|||
class EmptyMetricsException(DCOSException): | |||
def __init__(self): | |||
DCOSException.__init__(self, 'No metrics found') |
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.
As we don't have to support Python 2, could you switch this to super().__init__( 'No metrics found')
?
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.
👍
except EmptyMetricsException: | ||
pass | ||
|
||
app_datapoints = _fetch_metrics_datapoints(app_url) |
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.
Is it possible that we have the other way around, container data exists but not app data?
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.
No, there will always be app data because we always pass two app values from the mesos module:
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.
LGTM, CI is currently broken but once we'll merge #1094 I'll trigger CI here.
run linux integration tests |
@philipnrmn : there are a few code style errors :
You can check these locally by running I just noticed btw that CI continues and runs tests even though it's going to fail eventually because of syntax errors... I'll look into it. |
When container metrics (`/v0/containers/<c-id>`) returns a 204 empty response, we should still check the app metrics (`/v0/containers/<c-id>/app`) endpoint, which may have data. This test replicates the task metrics details test, but responds with a 204 Empty followed by a 200 OK. Without the accompanying fix, it will fail.
6867884
to
b13c6ae
Compare
run linux integration tests |
* Use dedicated exception class when metrics response is empty * Add test for empty container metrics When container metrics (`/v0/containers/<c-id>`) returns a 204 empty response, we should still check the app metrics (`/v0/containers/<c-id>/app`) endpoint, which may have data. This test replicates the task metrics details test, but responds with a 204 Empty followed by a 200 OK. Without the accompanying fix, it will fail. * Catch empty metrics exception for container datapoints
This PR fixes DCOS-19009
Running
dcos task metrics details <task-id>
does the following:.../metrics/v0/containers/<container-id>
.../metrics/v0/containers/<container-id>/app
In some cases, container metrics are not present and the dcos-metrics API returns a 204 empty. We were assuming in those cases that there were also no app metrics. Unfortunately, that is not correct in cases of executors, as in DC/OS SDK frameworks like cassandra and kafka.
With this PR, we catch the empty case and poll app metrics as well.