diff --git a/x-pack/elastic-agent/pkg/agent/application/paths/files.go b/x-pack/elastic-agent/pkg/agent/application/paths/files.go index 44ec030ba6c9..b2f3215d5168 100644 --- a/x-pack/elastic-agent/pkg/agent/application/paths/files.go +++ b/x-pack/elastic-agent/pkg/agent/application/paths/files.go @@ -20,10 +20,10 @@ const defaultAgentFleetFile = "fleet.yml" // defaultAgentEnrollFile is a name of file used to enroll agent on first-start const defaultAgentEnrollFile = "enroll.yml" -// defaultAgentActionStoreFile is the file that will contains the action that can be replayed after restart. +// defaultAgentActionStoreFile is the file that will contain the action that can be replayed after restart. const defaultAgentActionStoreFile = "action_store.yml" -// defaultAgentStateStoreFile is the file that will contains the action that can be replayed after restart. +// defaultAgentStateStoreFile is the file that will contain the action that can be replayed after restart. const defaultAgentStateStoreFile = "state.yml" // AgentConfigFile is a name of file used to store agent information diff --git a/x-pack/elastic-agent/pkg/agent/storage/store/state_store.go b/x-pack/elastic-agent/pkg/agent/storage/store/state_store.go index 902e5f9f746c..c370b941b151 100644 --- a/x-pack/elastic-agent/pkg/agent/storage/store/state_store.go +++ b/x-pack/elastic-agent/pkg/agent/storage/store/state_store.go @@ -11,7 +11,7 @@ import ( "io" "sync" - yaml "gopkg.in/yaml.v2" + "gopkg.in/yaml.v2" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/storage" @@ -46,7 +46,7 @@ type action = fleetapi.Action // receives multiples actions to persist to disk, the implementation of the store only // take care of action policy change every other action are discarded. The store will only keep the // last good action on disk, we assume that the action is added to the store after it was ACK with -// Fleet. The store is not threadsafe. +// Fleet. The store is not thread safe. type StateStore struct { log *logger.Logger store storeLoad diff --git a/x-pack/elastic-agent/pkg/core/monitoring/beats/beats_monitor.go b/x-pack/elastic-agent/pkg/core/monitoring/beats/beats_monitor.go index 939aa89c99d5..083e2803a0a3 100644 --- a/x-pack/elastic-agent/pkg/core/monitoring/beats/beats_monitor.go +++ b/x-pack/elastic-agent/pkg/core/monitoring/beats/beats_monitor.go @@ -23,8 +23,8 @@ import ( const httpPlusPrefix = "http+" const defaultMonitoringNamespace = "default" -// Monitor is a monitoring interface providing information about the way -// how beat is monitored +// Monitor implements the monitoring.Monitor interface providing information +// about beats. type Monitor struct { operatingSystem string config *monitoringConfig.MonitoringConfig @@ -209,7 +209,7 @@ func (b *Monitor) Prepare(spec program.Spec, pipelineID string, uid, gid int) er } // LogPath describes a path where application stores logs. Empty if -// application is not monitorable +// application is not monitorable. func (b *Monitor) LogPath(spec program.Spec, pipelineID string) string { if !b.WatchLogs() { return "" diff --git a/x-pack/elastic-agent/pkg/core/monitoring/monitor.go b/x-pack/elastic-agent/pkg/core/monitoring/monitor.go index 71e78d20a515..3294405d3632 100644 --- a/x-pack/elastic-agent/pkg/core/monitoring/monitor.go +++ b/x-pack/elastic-agent/pkg/core/monitoring/monitor.go @@ -29,7 +29,7 @@ type Monitor interface { Close() } -// NewMonitor creates a monitor based on a process configuration. +// NewMonitor creates beats a monitor based on a process configuration. func NewMonitor(cfg *configuration.SettingsConfig) (Monitor, error) { logMetrics := true if cfg.LoggingConfig != nil { diff --git a/x-pack/elastic-agent/pkg/core/plugin/process/start.go b/x-pack/elastic-agent/pkg/core/plugin/process/start.go index b946e692cfe4..1b52163976cf 100644 --- a/x-pack/elastic-agent/pkg/core/plugin/process/start.go +++ b/x-pack/elastic-agent/pkg/core/plugin/process/start.go @@ -39,7 +39,7 @@ func (a *Application) start(ctx context.Context, t app.Taggable, cfg map[string] }() // starting only if it's not running - // or if it is, then only in case it's restart and this call initiates from restart call + // or if it is, then only in case it's a restart and this call initiates from restart call if a.Started() && a.state.Status != state.Restarting { if a.state.ProcessInfo == nil { // already started if not stopped or crashed diff --git a/x-pack/elastic-agent/pkg/core/plugin/service/app.go b/x-pack/elastic-agent/pkg/core/plugin/service/app.go index 4b0d2b8ee0a7..5272c8b7cdf3 100644 --- a/x-pack/elastic-agent/pkg/core/plugin/service/app.go +++ b/x-pack/elastic-agent/pkg/core/plugin/service/app.go @@ -296,7 +296,7 @@ func (a *Application) Shutdown() { // OnStatusChange is the handler called by the GRPC server code. // -// It updates the status of the application and handles restarting the application is needed. +// It updates the status of the application and handles restarting the application when needed. func (a *Application) OnStatusChange(s *server.ApplicationState, status proto.StateObserved_Status, msg string, payload map[string]interface{}) { a.appLock.Lock() defer a.appLock.Unlock()