-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
cassandra: JMX prometheus exporter #3228
Conversation
7415fb1
to
d02f91f
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.
Would be good if you could verify the Prometheus annotations position with, e.g., prometheus-operator to see that Prometheus picks the Pods up.
d02f91f
to
8c8d782
Compare
8c8d782
to
33b02b0
Compare
There is new option in cluster.cassandra CRD, which provides the ability to specify ConfigMap for jmx-prometheus-exporter for Cassandra Rack. |
33b02b0
to
ed08b53
Compare
@nabokihms this is excellent! |
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.
@nabokihms thanks a lot for your work!
I have a few comments on the sidecar code, but other than that it looks great.
In addition, ConfigMap updates are currently not handled. This means that if a ConfigMap is updated, changes will be propagated but the Pods won't be restarted (which I assume is necessary for jmx_exporter to pick up the changes).
We can either:
- Implement an update mechanism. For example, save the ConfigMap SHA-256 hash in a label of each StatefulSet's PodTemplate. This way, a change in the ConfigMap hash will trigger a rolling update across all Racks.
- Leave that for later and instead document how to change the ConfigMap manually. The process is
- Apply new ConfigMap.
- Rolling restart all Racks:
statefulsets=[...] for name in statefulsets: kubectl rollout restart statefulset $name -n $namespace
@nabokihms any update on this? |
@yanniszark I will finish this till weekends. |
@nabokihms How is this looking? We are starting to lock down for the 1.2 release by the end of the week. Thanks! |
Thanks for informing me. We want to merge it in 1.2. I will try my best to end work on the PR till tomorrow. |
5ae2029
to
24f17c7
Compare
I made the necessary changes and also updated the docs to make difficult cases clear. |
Is this getting any more love soon? Would be nice to have the option to use the jmx exporter and it looks like 90% of the work is already done 🚀 |
@paulcostinean thanks for the ping! :) |
@nabokihms thanks a lot for your effort!
rm -rf vendor
GO111MODULE=off make vendor
GO111MODULE=off make codegen
NAMESPACE=<namespace>
CLUSTER=<cluster_name>
RACKS=$(kubectl get sts -n ${NAMESPACE} -l "cassandra.rook.io/cluster=${CLUSTER}")
echo ${RACKS} | xargs -n1 kubectl rollout restart -n ${NAMESPACE} To make it more comfortable, I included these changes in a review branch, so you can see what I mean: After that, we should be ready to merge! |
24f17c7
to
a5c9481
Compare
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
7d9a62b
to
6e4fe64
Compare
@yanniszark Thanks a lot for the PR review and especially for the review branch! It helps a lot. I merged all the changes to the current branch. |
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.
@nabokihms thanks for all the great work!
I tested and everything looks good.
You just have a small bug that was caught by a unit test (that's why the CI was failing).
More specifically, you need to check if the jmxExporterConfigMapName field is nil before dereferencing.
I have included comments in the relevant parts.
Other than that, we're good to go!
/lgtm
/approve
If needed, I will approve again after the necessary changes.
Let's get this through the door!
6e4fe64
to
4373ea7
Compare
I see errors in two tests: |
Export prometheus metrics for cassandra in sidecar container Signed-off-by: Maksim Nabokikh <maksim.nabokikh@flant.com>
4373ea7
to
7dc9ec1
Compare
Export prometheus metrics for cassandra in sidecar container
Signed-off-by: Maksim Nabokikh maksim.nabokikh@flant.com
Description of your changes:
Add jmx exporter with standard configuration to sidecar container.
Test steps:
tests/scripts/minikube.sh up
cluster/examples/kubernetes/cassandra
This dashboard seems ok https://grafana.com/dashboards/5408 for monitoring
Which issue is resolved by this Pull Request:
Resolves #2530
Checklist:
make codegen
) has been run to update object specifications, if necessary.[test cassandra]