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

mgr/influx: PEP-8 and other fixes to Influx module #19229

Merged
merged 4 commits into from Dec 13, 2017
Merged

Conversation

wido
Copy link
Member

@wido wido commented Nov 29, 2017

This PR fixes two things:

  • PEP-8 fixes to Influx module
  • Send fsid as a tag to Influx
  • Update module configuration
  • Updated logging of module

By sending the fsid as a tag to Influx we can have multiple clusters send their data to the same Influx database.

@wido wido added the mgr label Nov 29, 2017
@wido wido added this to the luminous milestone Nov 29, 2017
@wido wido requested a review from jcsp November 29, 2017 08:11
@tchaikov tchaikov removed this from the luminous milestone Nov 29, 2017
@tchaikov
Copy link
Contributor

tchaikov commented Nov 29, 2017

@wido we add milestone for PRs targeting non-master branches. i am assuming that you want to backport this change to luminous without an accompanied tracker ticket here, so added the "need-backport" label instead.

@tchaikov tchaikov changed the title PEP-8 Fixes to Influx module and send fsid mgr/influx: PEP-8 Fixes to Influx module and send fsid Nov 29, 2017
@@ -25,6 +25,9 @@ def __init__(self, *args, **kwargs):
self.event = Event()
self.run = True

def get_fsid(self):
return self.get('osd_map')['fsid']
Copy link
Contributor

@jcsp jcsp Nov 29, 2017

Choose a reason for hiding this comment

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

I'd suggest using mon_map here, just to save a few cycles as osdmap can be rather large.

@@ -55,6 +58,7 @@ def get_df_stats(self):
"pool_id" : pool['id'],
"type_instance" : df_type,
"mgr_id" : self.get_mgr_id(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed this rogue mgr_id label here, let's remove this while we're updating labels

@jcsp
Copy link
Contributor

jcsp commented Nov 29, 2017

Looks sane, just the two comments.

The mgr_id bit isn't your fault but we should make the update in this PR so that people don't get their series labels changing twice.

Can you also update the commit messages to say "mgr/influx" instead of "Mgr Influx"? Weirdly they look right in some of the places in github but I think the actual commits still have the latter format.

@wido
Copy link
Member Author

wido commented Dec 4, 2017

@jcsp Thanks! I've addressed your comments in my commits.

The code now scores:

  Your code has been rated at 8.94/10

Various indentation fixes, whitespaces and other PEP-8 related changes

Signed-off-by: Wido den Hollander <wido@42on.com>
This allows for multiple Ceph clusters to send their data to the
same Influx database.

Using the fsid values for different clusters can be queried from
Influx

Signed-off-by: Wido den Hollander <wido@42on.com>
It's a lot like the Zabbix module and allows for setting configuration
options on run-time and also fetch them from the module.

A few additional commands have been registered to make sure it is easy
to interact with the module.

Signed-off-by: Wido den Hollander <wido@42on.com>
On large clusters it might take a very long time to send data to Influx
due to the gathering and parsing of statistics.

By keeping a counter and printing it admins can adjust the interval if it
becomes to heavy for their cluster.

Signed-off-by: Wido den Hollander <wido@42on.com>
@wido wido changed the title mgr/influx: PEP-8 Fixes to Influx module and send fsid mgr/influx: PEP-8 and other fixes to Influx module Dec 11, 2017
@wido
Copy link
Member Author

wido commented Dec 11, 2017

@jcsp: While testing more with this module I wrote a bit more code and added commits to this PR.

Should make this module work a lot nicer.

@jcsp jcsp merged commit ab3faa4 into ceph:master Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants