Skip to content
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

fix: modernize Ceph input plugin metrics #10797

Merged
merged 29 commits into from
Sep 14, 2022
Merged

fix: modernize Ceph input plugin metrics #10797

merged 29 commits into from
Sep 14, 2022

Conversation

G-regL
Copy link
Contributor

@G-regL G-regL commented Mar 8, 2022

Required for all PRs:

resolves #10788

The Ceph input plugin was likely written against version 11 or 12 of Ceph, but since then there's been some changes to the data structures that the respective ceph commands use for cluster-level statistics.

This PR aims to bring those values back inline with at least version 15 of Ceph.

@G-regL G-regL changed the title Update Ceph input plugin for current versions of Ceph Modernize Ceph input plugin metrics Mar 8, 2022
@G-regL G-regL changed the title Modernize Ceph input plugin metrics fix: modernize Ceph input plugin metrics Mar 8, 2022
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great you are willing to modernise this input, but I have some doubts about backwards compatibility.

@Hipska Hipska added fix pr to fix corresponding bug area/ceph plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Mar 23, 2022
G-regL and others added 3 commits March 24, 2022 13:38
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Versions of Ceph <15 used to have their OSD maps nested, but newer ones don't. This change aims to capture both situations properly.
@Hipska Hipska added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Mar 25, 2022
Removed uneeded comments
Remove fields that will never exist
update tests
@reimda
Copy link
Contributor

reimda commented Apr 14, 2022

Hi Greg, could you rebase this on current master? CI isn't running on this branch. Rebasing will pull in the new circle ci config and should trigger CI to run again.

@reimda
Copy link
Contributor

reimda commented Apr 19, 2022

Thanks for merging master to get CI working.

I did a quick review of the PR and it's great that you've made it compatible with new versions of ceph. I'm concerned that it may break compatibility with older versions. Do you know if the PR will work with older versions?

It looks like the changes to the unit tests affect both input json and expected metrics. Could we leave the old test cases as they were to show the plugin still works when run with older ceph versions, and add new test cases to cover the new json format?

@reimda
Copy link
Contributor

reimda commented May 12, 2022

Hi @G-regL, were you able to look into compatibility with older versions of Ceph?

@reimda reimda added the waiting for response waiting for response from contributor label May 12, 2022
@G-regL
Copy link
Contributor Author

G-regL commented May 13, 2022

I hadn't looked at it since your previous comment, but in looking at it now, there's two unit tests, one which covers the old data for Cluster Status; clusterStatusDump, and cephStatusResults are for new data, while clusterStatusDumpNestedOSD, and cephStatusResultsNestedOSD are for old data.

Was there something more specific you were looking for cover?

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label May 13, 2022
@powersj
Copy link
Contributor

powersj commented May 16, 2022

I hadn't looked at it since your previous comment, but in looking at it now, there's two unit tests, one which covers the old data for Cluster Status; clusterStatusDump, and cephStatusResults are for new data, while clusterStatusDumpNestedOSD, and cephStatusResultsNestedOSD are for old data.

Was there something more specific you were looking for cover?

Looking at plugins/inputs/ceph/ceph_test.go there is a cephDFDump which has some sample JSON data in it for example. It no longer has some specific fields that were there previously. This tends to raise some concern if older test cases were changed without maintaining backward compatibility.

Should this change have been a new test case?

Thanks - trying to ensure we aren't suddenly breaking existing users as Dave pointed out.

@reimda reimda removed the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jun 6, 2022
@powersj powersj added the waiting for response waiting for response from contributor label Sep 13, 2022
@powersj
Copy link
Contributor

powersj commented Sep 13, 2022

Given version 16 of Ceph is currently the oldest version of ceph now supported, I'm going to retract my questions about tests.

@G-regL - if you could update the PR with some of our recent changes to the sample config and build tags we can look to getting this added.

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Sep 13, 2022
@G-regL
Copy link
Contributor Author

G-regL commented Sep 14, 2022

I can certainly update the sample config, but I don't quite know what you mean with regards to the build tags.

@Hipska Hipska added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Sep 14, 2022
@telegraf-tiger
Copy link
Contributor

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for all your effort @G-regL!

@srebhan srebhan merged commit 21a7d6f into influxdata:master Sep 14, 2022
reimda pushed a commit that referenced this pull request Sep 19, 2022
dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ceph input not properly reporting all statistics
6 participants