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

[8.7](backport #34456) Report FQDN on host.name enabled by a feature flag #34860

Merged
merged 5 commits into from
Apr 5, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 20, 2023

This is an automatic backport of pull request #34456 done by Mergify.
Cherry-pick of faf4c11 has failed:

On branch mergify/bp/8.7/pr-34456
Your branch is up to date with 'origin/8.7'.

You are currently cherry-picking commit faf4c11477.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG.next.asciidoc
	modified:   NOTICE.txt
	modified:   auditbeat/auditbeat.reference.yml
	modified:   auditbeat/docs/configuring-howto.asciidoc
	modified:   dev-tools/notice/overrides.json
	modified:   filebeat/beater/filebeat.go
	modified:   filebeat/config/config.go
	modified:   filebeat/docs/configuring-howto.asciidoc
	modified:   filebeat/filebeat.reference.yml
	modified:   heartbeat/docs/configuring-howto.asciidoc
	modified:   heartbeat/heartbeat.reference.yml
	modified:   libbeat/_meta/config/default.reference.yml.tmpl
	new file:   libbeat/_meta/config/feature-flags.reference.yml.tmpl
	modified:   libbeat/beat/info.go
	new file:   libbeat/beat/info_test.go
	modified:   libbeat/cmd/instance/beat.go
	new file:   libbeat/docs/shared-feature-flags.asciidoc
	new file:   libbeat/features/features.go
	new file:   libbeat/features/features_test.go
	modified:   libbeat/management/management.go
	modified:   libbeat/processors/add_host_metadata/add_host_metadata.go
	modified:   libbeat/processors/add_host_metadata/add_host_metadata_test.go
	modified:   libbeat/publisher/processing/default.go
	modified:   metricbeat/docs/configuring-howto.asciidoc
	modified:   metricbeat/metricbeat.reference.yml
	modified:   packetbeat/docs/configuring-howto.asciidoc
	modified:   packetbeat/packetbeat.reference.yml
	modified:   winlogbeat/winlogbeat.reference.yml
	modified:   x-pack/auditbeat/auditbeat.reference.yml
	modified:   x-pack/filebeat/filebeat.reference.yml
	modified:   x-pack/functionbeat/functionbeat.reference.yml
	modified:   x-pack/heartbeat/heartbeat.reference.yml
	modified:   x-pack/libbeat/management/generate.go
	modified:   x-pack/libbeat/management/managerV2.go
	modified:   x-pack/libbeat/management/managerV2_test.go
	modified:   x-pack/metricbeat/metricbeat.reference.yml
	modified:   x-pack/osquerybeat/osquerybeat.reference.yml
	modified:   x-pack/packetbeat/packetbeat.reference.yml
	modified:   x-pack/winlogbeat/winlogbeat.reference.yml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.mod
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify bot requested review from a team as code owners March 20, 2023 21:27
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Mar 20, 2023
@mergify mergify bot requested review from rdner and fearful-symmetry and removed request for a team March 20, 2023 21:27
@mergify mergify bot requested review from michalpristas and blakerouse and removed request for a team March 20, 2023 21:27
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 20, 2023
@botelastic
Copy link

botelastic bot commented Mar 20, 2023

This pull request doesn't have a Team:<team> label.

@ycombinator ycombinator assigned ycombinator and unassigned AndersonQ Mar 20, 2023
@ycombinator
Copy link
Contributor

I see the conflicts and will work on resolving them.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 20, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-04-05T14:45:56.226+0000

  • Duration: 129 min 17 sec

Test stats 🧪

Test Results
Failed 0
Passed 25977
Skipped 1968
Total 27945

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor Author

mergify bot commented Mar 27, 2023

This pull request has not been merged yet. Could you please review and merge it @ycombinator? 🙏

@ycombinator ycombinator force-pushed the mergify/bp/8.7/pr-34456 branch 2 times, most recently from 60ecd1d to 6d8820c Compare March 29, 2023 16:15
@ycombinator
Copy link
Contributor

The CI failures are (somehow) related to this backport PR. They are not happening on the 8.7 branch. I'm able to reproduce them locally. Investigating...

@ycombinator
Copy link
Contributor

ycombinator commented Mar 29, 2023

The CI failures seem to be happening because this backport PR updates the dependency on elastic-agent-shipper-client from 0.4.0 -> 0.5.x. The latter version contains fixes that require changes in the Beats codebase.

These changes were done on the main branch in #34596. I see that that PR had an 8.7 backport PR, #34681, but for some reason it was closed without merging. @cmacknz @fearful-symmetry should we reopen that backport PR and merge it (before this PR here)?

@fearful-symmetry
Copy link
Contributor

@ycombinator is there a reason the elastic-agent-shipper-client dep is updated? I assume something else depends on it?

I assume the original backport was never merged as the shipper isn't supported, so we weren't worried about backports. I kind of don't want to put ourselves in a situation where we're trying to fix shipper code on releases where the shipper doesn't actually work and isn't supported, but just merging that backport might be the easiest solution, I'm not sure.

@ycombinator
Copy link
Contributor

@ycombinator is there a reason the elastic-agent-shipper-client dep is updated? I assume something else depends on it?

I'm glad you asked about this 🙂. Looking at the original PR (#34456), it does not upgrade the elastic-agent-shipper-client dependency. So I'm not sure how that snuck into this backport PR. Looks like this backport PR needs some cleanup in go.mod and go.sum. Let me work on that. No need to reopen #34681; sorry to bother you and Craig.

@ycombinator ycombinator force-pushed the mergify/bp/8.7/pr-34456 branch 2 times, most recently from faf3aa6 to 59d56ce Compare March 30, 2023 00:16
@mergify
Copy link
Contributor Author

mergify bot commented Mar 30, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.7/pr-34456 upstream/mergify/bp/8.7/pr-34456
git merge upstream/8.7
git push upstream mergify/bp/8.7/pr-34456

@mergify
Copy link
Contributor Author

mergify bot commented Apr 3, 2023

This pull request has not been merged yet. Could you please review and merge it @ycombinator? 🙏

AndersonQ and others added 4 commits April 4, 2023 16:04
* wip

* wip

* wip

* something is broken

* debug logs

* avoid panics

* wip broken

* wip - perhaps fixed double configuring features

* using triggers to know what changed

* it works, but the agent-client is sending feature changes every time

* debug logs

* more debug logs

* wip

* it works

* remove debug logs

* fix after rebase

* update elastic-agent-client and make notice

* license headres

* Add TODO for Winlogbeat FQDN implementation

* Removing unnecesary code

* Use RWMutex for greater read efficiency

* Move mutex inside struct

* Better error handling

* Temporarily updating dependency

* Always store FQDN in Beat info

* Set hostname in monitoring registries after FQDN config has been evaluated

* Pass down FQDN flag from add_host_metadata processor

* Better error handling

* Add temporary notice override

* Changing log level

* Update dependency on elastic-agent-system-metrics

* Running go mod tidy

* Update elastic-agent-system-metrics dependency version

* Add feature flags configuration section to reference yml

* Bump up version of elastic-agent-client depdendency

* Updating reference file

* Updating reference files

* Move feature flags setting into same method where log level setting is handled

* Updating docs

* Adding CHANGELOG entry

* Remove replace directive for go-sysinfo

* Running go mod tidy

* Remove replace directive for elastic-agent-client dependency

* Remove personal repos from overrides.json

* Updating NOTICE

* Bump up version for elastic-agent-client dependency

* Update NOTICE

* Removing noisy debug logging

* Removing commented out code that's not needed

* Fixing error message

* Make default flag setting more explicit

* Adding config with no features to unit test

* Add helper method to beat.Info for returning FQDN-aware hostname

* Adding license header to test file

* Remove use of errors package

* Check error from data.Put

* Expire add_host_metadata cache immediately on FQDN feature flag value change

* Fix casing in error message

* Have callback registration function accept ID

* Fixing go formatting

* Account for feature flags in TestManagerV2 test

* Update logging for unit changes

* Remove TODO from wineventlog code

* Updating dependency

* Include shared file in docs

* Bumping dependency on elastic-agent-client

* Include features config in diagnostics output

* Update comment

* Updating NOTICE

* Re-formatting

* Running make update

---------

Co-authored-by: Shaunak Kashyap <[email protected]>
(cherry picked from commit faf4c11)

# Conflicts:
#	go.mod
#	go.sum
@ycombinator ycombinator force-pushed the mergify/bp/8.7/pr-34456 branch from 59d56ce to 3a2a102 Compare April 4, 2023 23:06
@ycombinator ycombinator merged commit 1cf2db5 into 8.7 Apr 5, 2023
@ycombinator ycombinator deleted the mergify/bp/8.7/pr-34456 branch April 5, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants