Now the engine resolves FQDN based on resolveHostnameToFqdn.
resolveHostnameToFqdn is set to false by default.
Simplified Host Resource creation in the agent.
Added --resolve-fqdn option to the CLI.
The Resource is now reported by the CLI.
Details
This pull request involves several significant changes to the metricshub-agent project, focusing on simplifying the configuration and resource handling, as well as improving the CLI service. The most important changes include the removal of the resolveHostnameToFqdn parameter from various methods, the reorganization of CLI options, and updates to the PrettyPrinterService for better resource attribute printing.
Configuration and Resource Handling Simplifications:
AgentConfig.java: Removed the default value for resolveHostnameToFqdn and made it a non-default field.
ConfigHelper.java: Updated buildHostConfiguration to use resourceConfig.getResolveHostnameToFqdn().
OtelHelper.java: Removed the resolveHostnameToFqdn parameter from createHostResource and related methods, simplifying the resource creation logic.
OtelHelperTest.java: Adjusted tests to reflect the removal of the resolveHostnameToFqdn parameter.
CLI Service Improvements:
MetricsHubCliService.java: Reorganized CLI options, including moving and renaming the --patch-directory option and adding a new --resolve-fqdn option.
PrettyPrinterService Enhancements:
PrettyPrinterService.java: Added headers for resource and attributes sections, and updated the printAttributes method to handle resource attributes separately.
Test Adjustments:
MonitoringTaskTest.java: Updated mocks to align with the changes in OtelHelper.
resolveHostnameToFqdn
.resolveHostnameToFqdn
is set tofalse
by default.--resolve-fqdn
option to the CLI.Details
This pull request involves several significant changes to the
metricshub-agent
project, focusing on simplifying the configuration and resource handling, as well as improving the CLI service. The most important changes include the removal of theresolveHostnameToFqdn
parameter from various methods, the reorganization of CLI options, and updates to thePrettyPrinterService
for better resource attribute printing.Configuration and Resource Handling Simplifications:
AgentConfig.java
: Removed the default value forresolveHostnameToFqdn
and made it a non-default field.ConfigHelper.java
: UpdatedbuildHostConfiguration
to useresourceConfig.getResolveHostnameToFqdn()
.OtelHelper.java
: Removed theresolveHostnameToFqdn
parameter fromcreateHostResource
and related methods, simplifying the resource creation logic.OtelHelperTest.java
: Adjusted tests to reflect the removal of theresolveHostnameToFqdn
parameter.CLI Service Improvements:
MetricsHubCliService.java
: Reorganized CLI options, including moving and renaming the--patch-directory
option and adding a new--resolve-fqdn
option.PrettyPrinterService Enhancements:
PrettyPrinterService.java
: Added headers for resource and attributes sections, and updated theprintAttributes
method to handle resource attributes separately.Test Adjustments:
MonitoringTaskTest.java
: Updated mocks to align with the changes inOtelHelper
.Testing