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

metricbeat vsphere add field #5646

Closed
adelbot opened this issue Nov 20, 2017 · 16 comments
Closed

metricbeat vsphere add field #5646

adelbot opened this issue Nov 20, 2017 · 16 comments
Labels

Comments

@adelbot
Copy link

adelbot commented Nov 20, 2017

For confirmed bugs, please report:

  • Version: 7.0.0-alpha1
  • Operating System: RedHat 7.4
  • Steps to Reproduce:

I'm looking for add network Name in event
like vm.Guest.net[].Network

@amandahla
Copy link

@adelbot Would you like this field at "virtualmachine" metric? Collecting network names for every virtual machine.

@adelbot
Copy link
Author

adelbot commented Nov 21, 2017 via email

@ruflin
Copy link
Contributor

ruflin commented Nov 21, 2017

Hi @adelbot

The library that is used to connect to the vSphere API is https://github.com/vmware/govmomi. So if the metrics are available through this library it should be possible to add them. I had a quick look at the code and there are quite a few Network fields. Could you link to the govmomi code which metrics you are referring to? Or feel free to directly open a PR with it.

@amandahla
Copy link

Just to share: I gave it a try but found a error then I opened a issue to govmomi. :-(
I believe that must be another ways to get this property, lets see.
vmware/govmomi#933

@amandahla
Copy link

amandahla commented Nov 23, 2017

@adelbot @ruflin Do you think it would be better to be optional? Like custom fields.

Event example:

Publish event: {
  "@timestamp": "2017-11-23T12:19:49.139Z",
  "@metadata": {
    "beat": "metricbeat",
    "type": "doc",
    "version": "7.0.0-alpha1"
  },
  "vsphere": {
    "virtualmachine": {
      "name": "machine",
      "cpu": {
        "used": {
          "mhz": 0
        }
      },
      "memory": {
        "total": {
          "guest": {
            "bytes": 2147483648
          }
        },
        "free": {
          "guest": {
            "bytes": 2083520512
          }
        },
        "used": {
          "host": {
            "bytes": 851443712
          },
          "guest": {
            "bytes": 63963136
          }
        }
      },
      "custom_fields": {
        "dtCriacaoVM": "2016-11-09 16:23:08",
        "Ambiente": "pro"
      },
      "network_names": {
        "name": "Gerencia Lab"
      },
      "host": "host-19"
    }
  },
  "metricset": {
    "host": "https://vcenter/sdk",
    "rtt": 3050826,
    "module": "vsphere",
    "name": "virtualmachine"
  },
  "beat": {
    "name": "metricbeat",
    "hostname": "host123",
    "version": "7.0.0-alpha1"
  }
}

@ruflin
Copy link
Contributor

ruflin commented Nov 26, 2017

As far as I understand, the fields added are:

      "custom_fields": {
        "dtCriacaoVM": "2016-11-09 16:23:08",
        "Ambiente": "pro"
      },
      "network_names": {
        "name": "Gerencia Lab"
      },

2 questions here:

  • It says network names, so could this be a list? Or is name a unique key?
  • What is in this custom fields? Are these values configured by the user? Or where are these fields coming from?

Sorry for potentially basic question but not really familiar with vsphere.

@adelbot
Copy link
Author

adelbot commented Nov 27, 2017

Hello,

  1. Yes, it could be a list
  2. The custom field can be configued by admin or by flow

@amandahla
Copy link

@ruflin custom_fields already exists, it's not a new field :-) I use custom_fields as example because he is collected only if the user says so. It's optional, not default. So, I thought that network_names could be the same thing. In config, we could have a "get_network_names" to be set true/false.

@ruflin
Copy link
Contributor

ruflin commented Nov 27, 2017

@amandahla Ah, great. Depending on how big the list is normally, I'm ok also to collect it by default (assuming it is like 1-3 entries normally). People that don't like it can filter it out. Like this we don't need to add a config option for it.

As network_names is a list, should it be:

    "network_names": [
        "Gerencia Lab",
        "Bla Lab",
      },

Otherwise we would have multiple name entries overwriting each other?

@amandahla
Copy link

@adelbot For metric "host", at least in the environment that I'm testing, we have a lot of "Distributed port group" instead of "Network". For this metric, is ok to collect only network names?

@amandahla
Copy link

@ruflin I believe that a list will work fine 👍

@amandahla
Copy link

This is a first version. I'll wait for adelbot to answer if is important/interesting to collect the Distributed port group names for host metric.

@ruflin
Copy link
Contributor

ruflin commented Nov 28, 2017

@adelbot Have a look at #5646
@amandahla Thanks for taking this over and push it so quickly.

@PauliniMrtns
Copy link

And can this custom_fields be generated by metricbeat it self or are they being pulled from VMWare directly?

Thanks

@amandahla
Copy link

@adelbot
Copy link
Author

adelbot commented Aug 26, 2019

so sorry !!!!
I don't read old comment ;-(
Yes, have a list of Distributed port group names of virtual is perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants