Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Danny Kulchinsky
    @dannyk81
    I'll check
    Daniel Pryor
    @pryorda
    @Jc2you around?
    @Jc2k: you around**
    Jc2k
    @Jc2k
    Hey sorry was fast asleep - what’s up?
    Daniel Pryor
    @pryorda
    @Jc2k trying to fix a bug in vmware_exporter lets talk tomorrow.
    ``` [2019-03-24 20:39:52.831535+00:00] Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 818, in _async_render_GET
    yield self.generate_latest_metrics(request)
    twisted.internet.defer.FirstError: FirstError[#2, [Failure instance: Traceback: <class 'twisted.internet.defer.FirstError'>: FirstError[#1, [Failure instance: Traceback: <class 'AttributeError'>: 'vim.Folder' object has no attribute 'datastoreFolder'Y
    Daniel Pryor
    @pryorda
    @Jc2k: So, I think part of the issue is the gathering of dcs from the root entity.
    I dont know if there is a good way to drill down in a folder vs object
    Jc2k
    @Jc2k
    i've paged this out already hmmmmm
    Daniel Pryor
    @pryorda
    if you add if isinsttance to each of the before the collect, it helps a bit, then you get a bunch of keyerrors
    Jc2k
    @Jc2k
    so i did have an experimental way of getting rid of the loops
    Daniel Pryor
    @pryorda
    Yeah?
    Jc2k
    @Jc2k
    trying to find the commit
    ah i bet it got squashed
    Daniel Pryor
    @pryorda
    if you need a vsphere set up to test against, I can create you a temporary account on my infra
    git ref-log?
    Jc2k
    @Jc2k
    so it was this PR: pryorda/vmware_exporter#67
    it has 2 commits, the 1st commit worked for me but was slower than the loopy approach so i adopted the approach from #66 instead
    ugh but theres a bunch of other stuff in the 2nd commit as well
    so i used batch_fetch_properties to fetch all folders, then as a seperate task i map each folder moId to a datcenter
    bah
    for dc in dcs: labels[moid] = [ result = yield threads.deferToThread(lambda: _collect(dc, dc.hostFolder)) host['name'], labels.update(result)
    da fu
            for dc in dcs:
                labels[moid] = [                result = yield threads.deferToThread(lambda: _collect(dc, dc.hostFolder))
                    host['name'],                labels.update(result)
    that part is what throws the error above
    if you do if hasattr(dc, dc.hostfolder): or or dc.datastoreFolder it gets further
    when you have a folder at the root level.
    Jc2k
    @Jc2k
    i have to head off home, but i've pulled some relevant bits out of old commits
    interested if that works for you
    its not finished
    the main thing thats missing is ds_cluster is hardcoded to ds_cluster
    and i've only tested against an esxi box
    will see if i can add ds_cluster tonight as well
    there is a performance hit on ESXi, but its still only around 11s
    Jc2k
    @Jc2k
    might have ds_cluster added but might need to take you up on vCenter creds to finish testing
    @pryorda going to bed now but if you could try ^ and let me know how you get on (just pushed a bit more)
    Daniel Pryor
    @pryorda
    Ill work on trying it out today, sorry for the delay been working on "work"
    Daniel Pryor
    @pryorda
    @Jc2k fix_folders works for nested directories. I'm going to create a beta build it it will let me.
    Daniel Pryor
    @pryorda
    @Jc2k let me know what you think about missing labels.
    Jc2k
    @Jc2k
    heya
    sorry its been a while i've forgotten what i did
    vague feeling the missing labels was maybe intentional because i didn't fully finish it yet
    Jc2k
    @Jc2k
    @pryorda left some requests on the PR
    Daniel Pryor
    @pryorda
    Ill take a peak