Repository navigation
mgr/telemetry: add stretch cluster data - #60606
Conversation
e672522 to
8ffc565
Compare
There was a problem hiding this comment.
Question: When do we nag users?
IIUC, we only do that for major data changes. What would constitute as major data changes? My assumption here for not nagging the user was that stretch_cluster is a small additive change and is not a sensitive information so it's okay to not nag the user. Please correct me if my understanding is wrong,
There was a problem hiding this comment.
Yes, you are correct with this assumption. We nagged when we added the perf channel since it was a bigger addition, but adding a smaller collection is usually not something we want to nag about. It would be good to confirm this with @yaarith though.
There was a problem hiding this comment.
Also, make sure to remove the comment.
There was a problem hiding this comment.
thanks for the clarification! have now removed the comment
There was a problem hiding this comment.
@Naveenaidu @ljflores that's right, we nag in case we wish the user to be aware of the change and consider to re-opt-in (usually after a major change).
8ffc565 to
ae100b1
Compare
ae100b1 to
c7b5358
Compare
|
jenkins test api |
yaarith
left a comment
There was a problem hiding this comment.
@Naveenaidu looks good!
We can squash the commits here.
There was a problem hiding this comment.
@Naveenaidu @ljflores that's right, we nag in case we wish the user to be aware of the change and consider to re-opt-in (usually after a major change).
|
@kamoltat can you please take a look? How would you suggest testing with actual values in: ? |
|
@ljflores should we update our upgrade tests with this new collection? |
c7b5358 to
77f2e9d
Compare
Hi @yaarith |
|
@yaarith, As suggested by @kamoltat I used his script to start a stretch cluster can verify that the correct data is indeed being printed in telemetry. The telemetry data that we get from the script: In the script we add two buckets - which matches the value of The script that was used to start a stretch cluster is: #!/bin/bash
if [[ "$@" != *"--skip-vstart"* ]]; then
MON=5 MDS=0 MGR=1 OSD=4 ../src/vstart.sh -n -x -l -d --without-dashboard
fi
if [[ "$@" != *"--skip-osd-check"* ]]; then
sleep 20
NUM_OSDS_UP=$(./bin/ceph osd df | grep "up" | wc -l)
if [ $NUM_OSDS_UP -lt 4 ]; then
echo "test requires at least 4 OSDs up and running"
exit 1
fi
fi
./bin/ceph mon set election_strategy connectivity
./bin/ceph mon add disallowed_leader e
for zone in iris pze
do
./bin/ceph osd crush add-bucket $zone zone
./bin/ceph osd crush move $zone root=default
done
./bin/ceph osd crush add-bucket node-2 host
./bin/ceph osd crush add-bucket node-3 host
./bin/ceph osd crush add-bucket node-4 host
./bin/ceph osd crush add-bucket node-5 host
./bin/ceph osd crush move node-2 zone=iris
./bin/ceph osd crush move node-3 zone=iris
./bin/ceph osd crush move node-4 zone=pze
./bin/ceph osd crush move node-5 zone=pze
./bin/ceph osd crush move osd.0 host=node-2
./bin/ceph osd crush move osd.1 host=node-3
./bin/ceph osd crush move osd.2 host=node-4
./bin/ceph osd crush move osd.3 host=node-5
./bin/ceph mon set_location a zone=iris host=node-2
./bin/ceph mon set_location b zone=iris host=node-3
./bin/ceph mon set_location c zone=pze host=node-4
./bin/ceph mon set_location d zone=pze host=node-5
hostname=$(hostname -s)
./bin/ceph osd crush remove $hostname
./bin/ceph osd getcrushmap > crushmap
./bin/crushtool --decompile crushmap > crushmap.txt
sed 's/^# end crush map$//' crushmap.txt > crushmap_modified.txt
cat >> crushmap_modified.txt << EOF
rule stretch_rule {
id 2
type replicated
step take default
step choose firstn 2 type zone
step chooseleaf firstn 2 type host
step emit
}
# end crush map
EOF
./bin/crushtool --compile crushmap_modified.txt -o crushmap.bin
./bin/ceph osd setcrushmap -i crushmap.bin
stretched_poolname=stretched_rbdpool
./bin/ceph osd pool create $stretched_poolname 32 32 stretch_rule
./bin/ceph osd pool set $stretched_poolname size 4
./bin/ceph mon set_location e zone=arbiter host=node-1
./bin/ceph mon enable_stretch_mode e stretch_rule zone
|
|
jenkins test api |
|
jenkins make check |
77f2e9d to
cff8a5f
Compare
Yes, @Naveenaidu let's update the upgrade tests. To give some context, we added some integration test coverage for telemetry in the form of workunits. Workunits are basically bash scripts that run commands against a Ceph cluster. These are the relevant workunit files for telemetry: These workunits are used in the upgrade suite, specifically in: The Similarly, the The All of this is to say, we should update the workunits above to reflect the new collection that was added. For the main PR, you'd only need to edit the Let me know if you have any questions or if I can clarify anything! |
|
I took off the "needs-qa" label for now until these changes are added. Then, we can send it to QA. |
|
jenkins test api |
Changes have been added since initially reviewing
|
#60984 is ready to be reviewed now, which should be merged before this PR. |
|
#60984 has been merged. This PR should be rebased. |
7677687 to
adcac85
Compare
ljflores
left a comment
There was a problem hiding this comment.
Hey @Naveenaidu, looking good! A couple of nits:
- The title of the second commit is on two lines when it should be on one:
qa/workunit: update telemetry quincy/reef workunits with
"basic_stretch_cluster" collection
Rather than
qa/workunit: update telemetry quincy/reef workunits with "basic_stretch_cluster" collection
- The first commit should have the tracker that we're fixing right above your Signed-off-by line:
Signed-off-by: <...>
Fixes: https://tracker.ceph.com/issues/67812
Also see below for a few clarifications about the workunit updates.
adcac85 to
ad48db3
Compare
Stretch Mode information helps us learn how deployments are done for stretch clusters. We add a basic_stretch_cluster collection fo the "basic" channel for this purpose. Fixes: https://tracker.ceph.com/issues/67812 Signed-off-by: Naveen Naidu <[email protected]>
…ch_cluster" collection Signed-off-by: Naveen Naidu <[email protected]>
ad48db3 to
4dac20e
Compare
|
The make check and api test failures are unrelated: |
|
jenkins test api |
|
jenkins test make check |
Closes: https://tracker.ceph.com/issues/67812
Stretch Mode information helps us learn how deployments are done for stretch clusters. We add a
basic_stretch_clustercollection to thebasicchannel for this purpose.The newly added
basic_stretch_clustercollection in thebasicchannel looks like:Things I learned (click on details to expand)
Details
Telemetry module is used to send anonymous data about the Ceph cluster to us which helps us understand how Ceph is being used in the wild. The code for this is present in here
As mentioned in the docs, there are two main concepts to telemetry:
The telemetry module is written is python and this code is extended with the C++ functions of our Ceph source code present in the
src/directory. The reason for writing telemetry module in python is to ease the development of adding new data to telemetry. Refer this to understand more about Python extensions.Code details
To add
stretch_modedata into telemetry, we need to do the following:stretch_modedata from the mapThe OSDMap class and it's information is present in the C code of ceph. We would need to invoke the dump function of the OSDMap class to get the required information. The telemetry module has a helper function called as
self.get('osd_map')to do exactly this. The list of all the cluster wide object that you are fetch are listed in the pydoc comment.The OSDMap cluster object we get is a dictionary. To fetch the stretch mode information, the stretch mode key is required. The name of this key can be found in the implementation of the
dumpmethod of OSDMap class. Depending on how the data is being dumped, you will need to extract the data accordingly.For eg: Stretch mode is dumped like this:
i.e it;s a JSON object with key
stretch_mode:To extract this data in telemetry python module you would do this and add it only when collection is enabled, you would do this:
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e