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

Report FQDN on host.name enabled by a feature flag #34456

Merged
merged 72 commits into from
Mar 20, 2023

Conversation

AndersonQ
Copy link
Member

@AndersonQ AndersonQ commented Feb 2, 2023

What does this PR do?

This PR enhances Beats to accept feature flag configuration either in standalone or managed mode. It also enhances Beats to report their host's FQDN when the FQDN feature flag is set.

For Beats running in standalone mode, feature flag configuration is defined in the <beat>.yml configuration file as follows:

features:
  <flagname>:
    enabled: true

For example, to run Metricbeat standalone with the FQDN feature flag enabled, configure the following section in metricbeat.yml:

features:
  fqdn:
    enabled:  true

Why is it important?

To enable use cases, particularly involving running multiple Beats in a containerized environment, where it's useful for every Beat to report it's host's FQDN.

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.

Author's Checklist

Effect on add_host_metadata processor

With FQDN feature flag disabled

beats_standalone_add_host_metadata_fqdn_disabled.mov

With FQDN feature flag enabled

beats_standalone_add_host_metadata_fqdn_enabled.mov

Effect on http.enabled: true setting

With FQDN feature flag disabled

beats_standalone_http_enabled_fqdn_disabled.mov

With FQDN feature flag enabled

beats_standalone_http_enabled_fqdn_enabled.mov

How to test this PR locally

See screen recordings in previous section.

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 2, 2023
@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @AndersonQ? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 2, 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-03-20T12:40:57.801+0000

  • Duration: 135 min 37 sec

Test stats 🧪

Test Results
Failed 0
Passed 26021
Skipped 1968
Total 27989

💚 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!)

@cmacknz
Copy link
Member

cmacknz commented Feb 8, 2023

There are a few other references to the host.name field besides just the one in add_host_metadata.

rg '"host.name"' -g '!*_test.go' -g '!*.py' -g '!*.json' will find them using ripgrep.

libbeat/processors/decode_xml_wineventlog/processor.go
libbeat/processors/add_host_metadata/add_host_metadata.go
libbeat/docs/troubleshooting/default_field.md
x-pack/filebeat/module/imperva/securesphere/config/liblogparser.js
x-pack/filebeat/module/fortinet/clientendpoint/config/liblogparser.js
x-pack/filebeat/module/fortinet/fortimanager/config/liblogparser.js
x-pack/filebeat/module/fortinet/fortimail/config/liblogparser.js
x-pack/filebeat/module/snort/log/config/liblogparser.js
x-pack/filebeat/module/infoblox/nios/config/liblogparser.js
x-pack/filebeat/module/radware/defensepro/config/liblogparser.js
x-pack/metricbeat/module/aws/cloudwatch/metadata/ec2/ec2.go
x-pack/filebeat/module/sophos/utm/config/liblogparser.js
x-pack/filebeat/module/juniper/junos/config/liblogparser.js
x-pack/filebeat/module/juniper/netscreen/config/liblogparser.js
x-pack/filebeat/module/zeek/dhcp/test/dhcp-json.log
x-pack/filebeat/module/o365/audit/config/pipeline.js
x-pack/filebeat/module/sonicwall/firewall/config/liblogparser.js
x-pack/filebeat/module/bluecoat/director/config/liblogparser.js
x-pack/filebeat/module/netscout/sightline/config/liblogparser.js
x-pack/filebeat/module/barracuda/waf/config/liblogparser.js
x-pack/filebeat/module/barracuda/spamfirewall/config/liblogparser.js
x-pack/filebeat/module/cisco/nexus/config/liblogparser.js
x-pack/filebeat/module/cisco/meraki/config/liblogparser.js
x-pack/filebeat/module/f5/bigipafm/config/liblogparser.js
x-pack/filebeat/module/proofpoint/emailsecurity/config/liblogparser.js
x-pack/filebeat/module/f5/bigipapm/config/liblogparser.js
x-pack/filebeat/module/microsoft/dhcp/config/liblogparser.js
x-pack/filebeat/module/squid/log/config/liblogparser.js
x-pack/filebeat/module/tomcat/log/config/liblogparser.js
x-pack/metricbeat/module/gcp/metrics/metricset.go
x-pack/filebeat/module/crowdstrike/falcon/ingest/firewall_match.yml
x-pack/filebeat/module/zscaler/zia/config/liblogparser.js
x-pack/metricbeat/module/azure/add_metadata.go
x-pack/filebeat/module/cylance/protect/config/liblogparser.js
winlogbeat/eventlog/eventlog.go
metricbeat/module/beat/state/data.go

@cmacknz
Copy link
Member

cmacknz commented Feb 8, 2023

It appears that the Windows event logs might be the FQDN by default. We should explicitly try to test and inspect the host.name value for each path in Beats that sets it to ensure it is consistent everywhere.

@mergify
Copy link
Contributor

mergify bot commented Feb 9, 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 1070-fqdn-feature-flag upstream/1070-fqdn-feature-flag
git merge upstream/main
git push upstream 1070-fqdn-feature-flag

@AndersonQ
Copy link
Member Author

There are a few other references to the host.name field besides just the one in add_host_metadata.

rg '"host.name"' -g '!*_test.go' -g '!*.py' -g '!*.json' will find them using ripgrep.

libbeat/processors/decode_xml_wineventlog/processor.go
libbeat/processors/add_host_metadata/add_host_metadata.go
libbeat/docs/troubleshooting/default_field.md
x-pack/filebeat/module/imperva/securesphere/config/liblogparser.js
x-pack/filebeat/module/fortinet/clientendpoint/config/liblogparser.js
x-pack/filebeat/module/fortinet/fortimanager/config/liblogparser.js
x-pack/filebeat/module/fortinet/fortimail/config/liblogparser.js
x-pack/filebeat/module/snort/log/config/liblogparser.js
x-pack/filebeat/module/infoblox/nios/config/liblogparser.js
x-pack/filebeat/module/radware/defensepro/config/liblogparser.js
x-pack/metricbeat/module/aws/cloudwatch/metadata/ec2/ec2.go
x-pack/filebeat/module/sophos/utm/config/liblogparser.js
x-pack/filebeat/module/juniper/junos/config/liblogparser.js
x-pack/filebeat/module/juniper/netscreen/config/liblogparser.js
x-pack/filebeat/module/zeek/dhcp/test/dhcp-json.log
x-pack/filebeat/module/o365/audit/config/pipeline.js
x-pack/filebeat/module/sonicwall/firewall/config/liblogparser.js
x-pack/filebeat/module/bluecoat/director/config/liblogparser.js
x-pack/filebeat/module/netscout/sightline/config/liblogparser.js
x-pack/filebeat/module/barracuda/waf/config/liblogparser.js
x-pack/filebeat/module/barracuda/spamfirewall/config/liblogparser.js
x-pack/filebeat/module/cisco/nexus/config/liblogparser.js
x-pack/filebeat/module/cisco/meraki/config/liblogparser.js
x-pack/filebeat/module/f5/bigipafm/config/liblogparser.js
x-pack/filebeat/module/proofpoint/emailsecurity/config/liblogparser.js
x-pack/filebeat/module/f5/bigipapm/config/liblogparser.js
x-pack/filebeat/module/microsoft/dhcp/config/liblogparser.js
x-pack/filebeat/module/squid/log/config/liblogparser.js
x-pack/filebeat/module/tomcat/log/config/liblogparser.js
x-pack/metricbeat/module/gcp/metrics/metricset.go
x-pack/filebeat/module/crowdstrike/falcon/ingest/firewall_match.yml
x-pack/filebeat/module/zscaler/zia/config/liblogparser.js
x-pack/metricbeat/module/azure/add_metadata.go
x-pack/filebeat/module/cylance/protect/config/liblogparser.js
winlogbeat/eventlog/eventlog.go
metricbeat/module/beat/state/data.go

luckily the huge majority of these files are the same, liblogparser.js, and so far I don't think we'll need to modify them.

There is indeed a few places that indeed use a different approach to populate host.name and winlogbeat is one of them.

@AndersonQ AndersonQ force-pushed the 1070-fqdn-feature-flag branch 2 times, most recently from f22ab3e to 7338984 Compare February 28, 2023 17:31
@endorama endorama added the Team:Elastic-Agent Label for the Agent team label Mar 1, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 1, 2023
@AndersonQ AndersonQ force-pushed the 1070-fqdn-feature-flag branch from 79506a8 to 8ce8fb0 Compare March 1, 2023 21:36
@ycombinator ycombinator force-pushed the 1070-fqdn-feature-flag branch from 8ce8fb0 to d36e29d Compare March 7, 2023 00:55
@@ -222,6 +222,7 @@ func (r *Renderer) renderSystem(handle EvtHandle, event *winevent.Event) error {
event.Channel = data.(string)
case EvtSystemComputer:
event.Computer = data.(string)
// TODO: set event.Computer to FQDN if features.FQDN() is true?
Copy link
Contributor

Choose a reason for hiding this comment

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

@efd6 @andrewkroh In this PR we're trying to set host.name in events generated by Beats to the FQDN if the Beat config contains features.fqdn.enabled: true. What's the best way to retrieve the FQDN on a Windows host? I assume this is the line in code where we'd want to set event.Computer to the FQDN if the feature is enabled?

Copy link
Member

Choose a reason for hiding this comment

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

First, a little background on where this event.Computer value comes from... I think the way Windows event log records work is that each event log record contains a ComputerName value that is determined at the time the event is generated. If the computer is not a member of a Active Directory domain when the log is written then it gets recorded with a short hostname (e.g. mymachine). If the computer is a member of an AD domain then it gets recorded as <hostname>.<ad-domain-name> (e.g. mymachine.company.com).

And be aware that the event log reader can read archived .evtx files that may have originated on a different machine (with a different hostname that the reader). Similarly event log records can be forwarded from one host to another and in this case they will have the source machine's hostname (or <hostname>.<domain> if it was a domain member).

For data integrity purposes I think we will want to keep the winlog.computer_name field exactly as it was in the source event log record. That value is copied directly into host.name so that is probably the location where we need to make some changes/decisions.

winevent.AddOptional(m, "host.name", e.Computer)

  • Perhaps we let add_host_metadata overwrite the host.name value with the appropriate host name value based on the features. Could make an exception for when the data is forwarded from another host or the data is read from an archived log? This is similar to what we tried to achieve in the default winlogbeat.yml config except I don't think this config overwrites the host.name value that was set from the ComputerName.

    - add_host_metadata:
    when.not.contains.tags: forwarded

  • In the case of forwarded logs or logs read from an .evtx file, should we try and normalize the value? For example if features.fqdn.enabled=false then do we try to trim the domain suffix if it is present in the event log's ComputerName?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the background and suggestions, @andrewkroh. I've created a separate issue to handle FQDN reporting for Windows hosts, as the use case urgently driving the FQDN feature implementation is for Beats running in containerized environments, which tend to be *nix most of the times. I've created #34782 to follow up on implementing FQDN reporting for Windows hosts.

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to keep this TODO in the code? From our previous discussion I believe we concluded we likely don't need to touch this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, we don't need this TODO any more. Removing...

@mergify
Copy link
Contributor

mergify bot commented Mar 8, 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 1070-fqdn-feature-flag upstream/1070-fqdn-feature-flag
git merge upstream/main
git push upstream 1070-fqdn-feature-flag

@ycombinator
Copy link
Contributor

@cmacknz Thanks for posting the rg command. I re-ran it, but also excluded files under Beat module folders and *.md files, and here' what comes up:

$ rg '"host.name"' -g '!*_test.go' -g '!*.py' -g '!*.json' -g '!*.md' -g '!**/*beat/module/**'
winlogbeat/eventlog/eventlog.go
101:	winevent.AddOptional(m, "host.name", e.Computer)

libbeat/processors/decode_xml_wineventlog/processor.go
149:	winevent.AddOptional(ecs, "host.name", evt.Computer)

libbeat/processors/add_host_metadata/add_host_metadata.go
152:		data.Put("host.name", p.config.Name)

For the first two results, related to hostnames on Windows, I'll follow up in #34456 (comment).

That leaves the last result, related to the add_host_metadata processor. This area has already been addressed in this PR.

Additionally, not seen in the rg results, there is also the hostname reported by the GET / and GET /state Beats HTTP APIs, which are called by the beat Metricbeat module, which Agent uses for monitoring it's component Beats' health. This area has also been addressed in this PR.

@ycombinator ycombinator force-pushed the 1070-fqdn-feature-flag branch from 26c38ad to 053ed7a Compare March 8, 2023 15:07
@ycombinator ycombinator marked this pull request as ready for review March 8, 2023 20:34
@ycombinator ycombinator requested review from a team as code owners March 8, 2023 20:34
@ycombinator ycombinator requested review from belimawr and leehinman and removed request for a team March 8, 2023 20:34
@ycombinator ycombinator force-pushed the 1070-fqdn-feature-flag branch from 454e4b0 to b0e457f Compare March 20, 2023 12:40
}
if state == client.UnitStateStopped {
if expected.Features != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Do we disable the feature if expected.Features == nil and the current Features configuration is not nil? Is this a case you need to handle, or does the agent always provided a non-nil Features in expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the beginning, before any feature flags are set, Agent will send a nil value for expected.Features. So this check here guards against that condition, preventing any unnecessary processing. Thereafter, whenever a feature flag gets set, Agent will only send non-nil values for expected.Features; see https://github.com/elastic/elastic-agent/pull/2218/files#diff-5570d8d3d94d053efb7e59bcad53e531bcf3a0ff5b8d3da9cc3334d859f095c9R176-R181

Since expected.Features is built to contain multiple features' configuration in it, we would only disable a feature if that particular feature's configuration within expected.Features indicated as such. For example, if expected.Features.FQDN.Enabled was set to false. AFAIU we have not designed for a use case of mass-disabling all features by setting expecting.Features to nil.

Copy link
Member

Choose a reason for hiding this comment

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

AFAIU we have not designed for a use case of mass-disabling all features by setting expecting.Features to nil.

That doesn't mean someone won't make that edit in the policy. IMO the most obvious thing to do is to translate that to disabling all features, that maps to what happens when you remove an input from the policy. We can file a follow up issue to deal with this, it is definitely an edge case.

ycombinator pushed a commit that referenced this pull request Mar 27, 2023
* 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 pushed a commit that referenced this pull request Mar 30, 2023
* 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 pushed a commit that referenced this pull request Apr 4, 2023
* 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 added a commit that referenced this pull request Apr 5, 2023
…flag (#34860)

* Report FQDN on host.name enabled by a feature flag (#34456)

* 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

* Remove conflict markers

* Updating NOTICE.txt

* Fixing dependency versions

* Fix CHANGELOG

---------

Co-authored-by: Anderson Queiroz <[email protected]>
Co-authored-by: Shaunak Kashyap <[email protected]>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.7.0 Automated backport with mergify enhancement Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report host name as FQDN on all platforms
8 participants