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

Issue #7187/fix vsphere metricbeat host #7213

Conversation

marian-craciunescu
Copy link
Contributor

@marian-craciunescu marian-craciunescu commented May 30, 2018

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@marian-craciunescu
Copy link
Contributor Author

marian-craciunescu commented May 31, 2018

@ruflin any idea how to fix the build failing , besides reverting the fields.yml ?

@ruflin
Copy link
Contributor

ruflin commented May 31, 2018

@marian-craciunescu Thanks for the PR. You have to run make update in the metricbeat directory so it updates all the generate files. This should get the build green.

if err != nil {
logp.Debug("vsphere", err.Error())
} else {
event["hostname"] = hostSystem.Summary.Config.Name
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put this under the global host.name field? See in ECS: https://github.com/elastic/ecs#host

It will require a bit more changes as with the Fetcher used here a few tricks must be applied to add fields on the root. I can help with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I can do it..But @bogd raised a valid concern.Maybe somebody is already using this field as it is.I do not know what is the current state for it right now (is vsphere only in beta? )

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, vsphere is still in beta to exactly allow such changes. I assume you are thinking of moving it for both metricsets which would make querying easier. Would be great to have that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the current ECS https://www.elastic.co/guide/en/ecs/current/ecs-host.html, it should be host.id and host.hostname.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, please ignore my comment above. I just saw #7213 (comment)

@karmi
Copy link

karmi commented May 31, 2018

Hi @marian-craciunescu, we have found your signature in our records, but it seems like you have signed with a different e-mail than the one used in yout Git commit. Can you please add both of these e-mails into your Github profile (they can be hidden), so we can match your e-mails to your Github profile?

@marian-craciunescu marian-craciunescu force-pushed the issue-#7187/fix-vmsphere-metricbeat-host branch from 171b48d to be1fcf9 Compare May 31, 2018 12:15
Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

Could you also add a changelog entry? If we add host.name to the other metricset too it should go under breaking changes.

You have to rebase again on master because of a conflicting change in fields.go. No need to try to merge it as it's auto generated with make update.

if err != nil {
logp.Debug("vsphere", err.Error())
} else {
event["hostname"] = hostSystem.Summary.Config.Name
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, vsphere is still in beta to exactly allow such changes. I assume you are thinking of moving it for both metricsets which would make querying easier. Would be great to have that.

@ruflin
Copy link
Contributor

ruflin commented Jun 19, 2018

@marian-craciunescu Any updates on this one?

@marian-craciunescu
Copy link
Contributor Author

@ruflin I will update the pull request soon.

@Eniqmatic
Copy link

Any update on this?

@ruflin ruflin added the Team:Integrations Label for the Integrations team label Nov 21, 2018
@alvarolobato
Copy link

Closing this PR due to inactivity. @marian-craciunescu please reopen if you decide to work again on this.

@marian-craciunescu
Copy link
Contributor Author

How should I procced to reopen this ?
Also it is not clear for me ...the hostname should be placed in the top field
host.name ? @alvarolobato @ruflin ?

@ruflin
Copy link
Contributor

ruflin commented Mar 18, 2019

@marian-craciunescu You should see a button below to reopen this PR, if not, let me know and I can reopen.

@webmat WDYT about the placement of host.name in this context?

@marian-craciunescu
Copy link
Contributor Author

@marian-craciunescu You should see a button below to reopen this PR, if not, let me know and I can reopen.
Sorry but I don't have that option.Only Delete branch and Delete fork

@ruflin ruflin reopened this Mar 18, 2019
@ruflin
Copy link
Contributor

ruflin commented Mar 18, 2019

@marian-craciunescu Just reopened it, hope that helps.

@marian-craciunescu
Copy link
Contributor Author

@marian-craciunescu Just reopened it, hope that helps.

Thanks..
I will make the checks to pass for now.
Do we still need to put that value in the host.name? If so , I think i need some hints on how to do it in order to be faster.

@webmat
Copy link
Contributor

webmat commented Mar 18, 2019

I'd be in favour of leaving the vsphere hostname where it is.

I consider host.* to be populated by add_host_metadata in Beats. Putting source-specific values there may change the semantics of the values seen in the event stream, and may be overwritten by the host metadata processor anyway.

@marian-craciunescu
Copy link
Contributor Author

marian-craciunescu commented Mar 18, 2019

I'd be in favour of leaving the vsphere hostname where it is.

I consider host.* to be populated by add_host_metadata in Beats. Putting source-specific values there may change the semantics of the values seen in the event stream, and may be overwritten by the host metadata processor anyway.
right now we have
vsphere.virtualmachine.host which is actually a vsphere internal id
[Example: host-167]
vsphere.virtualmachine.name which is something like a tag name put by the user
[ Example CLONE_8june2016 ]

Maybe it is better to have a structure like

{
  "vsphere": {
    "virtualmachine": {
      "host" : {
         "id": "host-167", # old host field
          "name": "CLONE_8june2016", # old name field
          "hostname": "real-host-machine" # newly added field
       }
    }
  }
}

@ruflin
Copy link
Contributor

ruflin commented Mar 19, 2019

@marian-craciunescu I like what you propose above that you reuse the host object from ECS. One challenge we have here is that this would probably be a breaking change?

@marian-craciunescu
Copy link
Contributor Author

@marian-craciunescu I like what you propose above that you reuse the host object from ECS. One challenge we have here is that this would probably be a breaking change?

I don't think will be a breaking change.Basically 2 fields will not be populated and will not exist anymore .I wil test with an existing mapping on my cluster and I wil get back with more info

@ruflin ruflin self-assigned this Jun 5, 2019
@marian-craciunescu
Copy link
Contributor Author

@marian-craciunescu a new commit pls, adding a line to
https://github.com/elastic/beats/blob/master/CHANGELOG.next.asciidoc

At section ==== Breaking changes then *metricbeat*

Add a line at the bottom of the block like

- vshpere module splits `virtualmachine.host` into `virtualmachine.host.id` and `virtualmachine.host.hostname`. {issue}7187[7187] {pull}7213[7213]

Done I would say

@marian-craciunescu
Copy link
Contributor Author

marian-craciunescu commented Nov 18, 2019

@odacremolbap the build is failing and it does not seems to be related to what I've did.
This is like an never ending story

Copy link
Contributor

@odacremolbap odacremolbap left a comment

Choose a reason for hiding this comment

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

thanks for your work so far, much appreciated.
can you check the 2 nits commented in the review?

@@ -51,7 +51,7 @@ import (

func init() {
common.RegisterCheckDeps(update.Update)

devtools.SetBuildVariableSources(devtools.DefaultBeatBuildVariableSources)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?
If not, can you remove that line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will remove it..it should not be be there

@@ -255,7 +255,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix marshaling of ms-since-epoch values in `elasticsearch/cluster_stats` metricset. {pull}14378[14378]
- Fix checking tagsFilter using length in cloudwatch metricset. {pull}14525[14525]
- Log bulk failures from bulk API requests to monitoring cluster. {issue}14303[14303] {pull}14356[14356]

- Vshpere module splits `virtualmachine.host` into `virtualmachine.host.id` and `virtualmachine.host.hostname`. {issue}7187[7187] {pull}7213[7213]
*Packetbeat*
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a blank line between your entry and the packetbeat section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@odacremolbap
Copy link
Contributor

odacremolbap commented Nov 18, 2019

@odacremolbap the build is failing and it does not seems to be related to what I've did.
This is like an never ending story

@marian-craciunescu we are very about to end the never ending story indeed :-)

CI has been a bit flaky lately, lots of new and old systems supported at beats now. We are actively working to improve that, in the meantime we can proceed if a failing test has nothing to do with the changes introduced.

I restarted the failing job and will re-check in a few.

offtopic: if you feel contributing is a pain, we are very willing to hear what we can improve from you. Feel encouraged to tell us if you like.

cc @andresrc

@marian-craciunescu
Copy link
Contributor Author

@odacremolbap the build is failing and it does not seems to be related to what I've did.
This is like an never ending story

@marian-craciunescu we are very about to end the never ending story indeed :-)

CI has been a bit flaky lately, lots of new and old systems supported at beats now. We are actively working to improve that, in the meantime we can proceed if the a failing test has nothing to do with the changes introduced.

I restarted the failing job and will re-check in a few.

offtopic: if you feel contributing is a pain, we are very willing to hear what we can improve from you. Feel encouraged to tell us if you like.

cc @andresrc

My problem was actually with the build system you are using.It's overly compliated and sincerely you don't need those auto generated parts (fields.go) .That could be added later , based on a branch trigger.
Except for that I really think there is a communication gap.I know you guys are busy ,but 4-5 days after a comment is posted here and nothing happened it's a little discouraging

@odacremolbap
Copy link
Contributor

jenkins test this

@odacremolbap odacremolbap self-requested a review November 19, 2019 09:18
@odacremolbap
Copy link
Contributor

@marian-craciunescu changes approved, and thanks a lot for the feedback.

can you solve that CHANGELOG.next conflict with master?

@marian-craciunescu
Copy link
Contributor Author

@marian-craciunescu changes approved, and thanks a lot for the feedback.

can you solve that CHANGELOG.next conflict with master?

Done

@odacremolbap odacremolbap added v7.5.0 test-plan Add this PR to be manual test plan and removed needs update test-plan Add this PR to be manual test plan v7.5.0 labels Nov 19, 2019
@odacremolbap odacremolbap merged commit 4288a56 into elastic:master Nov 19, 2019
odacremolbap pushed a commit to odacremolbap/beats that referenced this pull request Nov 19, 2019
* added host.id and host.hostname fields for vsphere

(cherry picked from commit 4288a56)
odacremolbap pushed a commit that referenced this pull request Nov 20, 2019
* added host.id and host.hostname fields for vsphere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat module review Team:Integrations Label for the Integrations team v7.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.