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

Remove agent.hostname field from libbeat #18328

Merged

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented May 6, 2020

What does this PR do?

agent.hostname is not part of ECS so this removes the field. Instead the
agent.name field can be used for this purpose and it it part of ECS.
This add an alias pointing from agent.hostname to agent.name. The alias
can be removed once we confirm all the Kibana apps are migrated to agent.name
for 8.0.

This will not be part of 7.x.

Why is it important?

From #16377

Specifically, a new field agent.hostname was introduced - however this field is not an ECS field, and it's continued use and documentation are creating user confusion.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Closes #16377

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 6, 2020
@andrewkroh andrewkroh added ecs Team:SIEM and removed needs_team Indicates that the issue/PR needs a Team:* label labels May 6, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

agent.hostname is not part of ECS so this removes the field. Instead the
agent.name field can be used for this purpose and it it part of ECS.
This add a migration alias pointing from agent.hostname to agent.name.

Closes elastic#16377
@andrewkroh andrewkroh force-pushed the feature/libbeat/remove-agent-hostname branch from 8463d27 to 4af663b Compare May 6, 2020 22:09
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 6, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [andrewkroh commented: run tests]

  • Start Time: 2020-05-12T13:16:57.670+0000

  • Duration: 92 min 22 sec (5541891)

Test stats 🧪

Test Results
Failed 0
Passed 7769
Skipped 1236
Total 9005

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov
    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Result: FAILURE

    • Duration: 2 min 22 sec

    • Start Time: 2020-05-12T14:25:20.716+0000

    • log

@andrewkroh
Copy link
Member Author

I created #18329 to track removing the old 6.x-to-7.0 migration aliases.

@andrewkroh andrewkroh added the Team:Services (Deprecated) Label for the former Integrations-Services team label May 6, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@andrewkroh andrewkroh marked this pull request as ready for review May 6, 2020 22:49
@andrewkroh andrewkroh requested review from a team as code owners May 6, 2020 22:49
@andrewkroh andrewkroh requested a review from exekias May 7, 2020 18:22
@@ -0,0 +1,17 @@
# The ECS migration file contains the information about all the Beats fields
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

Comment on lines 8 to 10
type: alias
path: agent.name
migration: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we want to keep an alias, is this used by any UI?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is at least one place using agent.hostname in Kibana. There may be more instances. So I'll remove the migration tag so that the alias always exists (at least until we can confirm all of Kibana is updated in 8.0).

I'll ask the uptime team if they can update 8.0 to use agent.name.

https://github.com/elastic/kibana/blob/523926f0a49a5bd951ed0e056610b049482adbca/x-pack/plugins/uptime/common/runtime_types/ping/ping.ts#L58

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

Thank you for tackling this! PR is looking good to me, just left a question on keeping the alias or not

Remove migration: true from beat.hostname alias.
We can add it back after we are sure that Kibana has been updated to
use beat.name for 8.0.
@andrewkroh
Copy link
Member Author

run tests

@andrewkroh andrewkroh merged commit 78b957a into elastic:master May 12, 2020
@kaiyan-sheng kaiyan-sheng mentioned this pull request Sep 8, 2021
19 tasks
@kaiyan-sheng
Copy link
Contributor

We are considering removing agent.hostname from libbeat for 8.0. @simianhacker Do you know if this field is still used by Kibana metrics UI?

@simianhacker
Copy link
Member

@kaiyan-sheng We are not using agent.hostname

@kaiyan-sheng
Copy link
Contributor

Thank you!! @simianhacker We will add removing agent.hostname to our todo list for 8.0 then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ecs libbeat review Team:Integrations Label for the Integrations team Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Beats use of non-ECS field agent.hostname causing user confusion
6 participants