-
Notifications
You must be signed in to change notification settings - Fork 210
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
Implement getPendingCompactions in HttpManagementProxy #1403
Implement getPendingCompactions in HttpManagementProxy #1403
Conversation
src/server/src/main/java/io/cassandrareaper/management/http/HttpMetricsProxy.java
Outdated
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpMetricsProxy.java
Outdated
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpMetricsProxy.java
Outdated
Show resolved
Hide resolved
e60aa87
to
1ac6f0b
Compare
5f795cc
to
19f8ce4
Compare
19f8ce4
to
0b745d7
Compare
e06d105
to
8ba1b20
Compare
8f738f7
to
e161f41
Compare
8ba1b20
to
56cc73e
Compare
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've done a preliminary review, I'll look more tomorrow. I have a few requested changes, but most aren't really blocking.
Given the tests are passing, I'm almost happy to approve immediately, but given the size of this PR I want to take another look over it. I can see why it took a little while!
src/server/src/main/java/io/cassandrareaper/management/MetricsProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/MetricsProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/MetricsProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpCassandraManagementProxy.java
Outdated
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpCassandraManagementProxy.java
Show resolved
Hide resolved
d72a78c
to
e2d1998
Compare
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 mentioned on slack, but I'm having issues with reviewing this due to noise in the diff (I think the last rebase I did was responsible, need to discuss how to do this better next time).
Can we maybe rebase this against the current integration branch so I have clearer visibility?
src/server/src/main/java/io/cassandrareaper/management/http/HttpCassandraManagementProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/MetricsProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpCassandraManagementProxy.java
Outdated
Show resolved
Hide resolved
Since metrics are now exposed on a different port than the mgmt-api itself, this required to go through the HttpMetricsProxy which got partially implemented for that need. It is now able to pull metrics from the metrics endpoint and parse it into GenericMetrics. Only tpstats are considered for now as the others are not needed for segments orchestration. Use the new prefix filter for metrics Fix failing ITs by switching to cassandra storage for HTTP ITs Add tmate for debugging CI Upgrade Cassandra versions for the mgmt-api tests Disable metrics pull checks in http ITs Add logging implement dropped message and client request metrics implement percent repaired method fix tests, fix pending compactions fix DroppedMessages test check, run all IT tests in CI update Cassandra 4.0.1 to 4.0.6 for tests Address Miles's comments Fail fast when reading dropped messages metrics in ITs
8baf990
to
8d7ef92
Compare
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.
Some more feedback now that I can see what's happening here a bit better. I might have yet more tomorrow once I've gone through this in more depth again.
Sorry, this is a relatively large PR, and the amount of refactoring required (because we're making compromises to get it across the line) makes the logic much harder to make out.
src/server/src/main/java/io/cassandrareaper/management/http/HttpMetricsProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpMetricsProxy.java
Show resolved
Hide resolved
src/server/src/main/java/io/cassandrareaper/management/http/HttpMetricsProxy.java
Show resolved
Hide resolved
throw new ReaperException("Error collecting metrics", e); | ||
} | ||
return genericMetrics.stream() | ||
.filter(metric -> metric.getMetricType().equals("ThreadPools")) |
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.
Question: If there is no MetricType with value ThreadPools
is this an error that should be thrown, or is it an expected condition which should return an empty list?
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.
Also, if the answer is that this should throw, can you go back through each method to ensure that they all have consistent behaviour in that regard.
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 about the runtime behavior here, so I'd go with returning an empty list if no metric matches the requested metric type.
enabled: true | ||
|
||
cassandra: |
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.
Question: Is all of this new stuff required?
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.
yep, we need the driver configuration to connect to Cassandra.
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 still waiting on a response here.
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.
@adejanovski is going to fix a duplicated block in the Reaper config for the acceptance tests, and also link to the metrics proxy refactoring ticket he raised.
Otherwise, this is approved.
enabled: true | ||
|
||
cassandra: |
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 still waiting on a response here.
Here's the follow up ticket: #1423 |
b9578bf
into
integration/http-managementproxy
Fixes #1382
Since metrics are now exposed on a different port than the mgmt-api itself, this required to go through the HttpMetricsProxy which got partially implemented for that need.
It is now able to pull metrics from the metrics endpoint and parse it into JmxStat objects (which will need to be later refactored to a new name).
Only tpstats are considered for now as the others are not needed for segments orchestration.