Skip to content

Commit 34b3ba6

Browse files
juliaElasticwildemat
authored andcommitted
[Fleet] reduce info logging in Fleet tasks (elastic#241811)
## Summary Since enabling elastic#235842, info logging increased substantially in cloud, because the agent status change task runs every minute. Changing the task start and end messages to be on debug level. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
1 parent 48e386a commit 34b3ba6

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

x-pack/platform/plugins/shared/fleet/server/tasks/agent_status_change_task.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { SO_SEARCH_LIMIT } from '../constants';
2727
import { getAgentPolicySavedObjectType } from '../services/agent_policy';
2828

2929
export const TYPE = 'fleet:agent-status-change-task';
30-
export const VERSION = '1.0.1';
30+
export const VERSION = '1.0.2';
3131
const TITLE = 'Fleet Agent Status Change Task';
3232
const SCOPE = ['fleet'];
3333
const DEFAULT_INTERVAL = '1m';
@@ -117,7 +117,7 @@ export class AgentStatusChangeTask {
117117
}
118118

119119
private endRun(msg: string = '') {
120-
this.logger.info(`[AgentStatusChangeTask] runTask ended${msg ? ': ' + msg : ''}`);
120+
this.logger.debug(`[AgentStatusChangeTask] runTask ended${msg ? ': ' + msg : ''}`);
121121
}
122122

123123
public runTask = async (
@@ -143,7 +143,7 @@ export class AgentStatusChangeTask {
143143
return getDeleteTaskRunResult();
144144
}
145145

146-
this.logger.info(`[runTask()] started`);
146+
this.logger.debug(`[runTask()] started`);
147147

148148
const [coreStart, _startDeps] = (await core.getStartServices()) as any;
149149
const esClient = coreStart.elasticsearch.client.asInternalUser;

x-pack/platform/plugins/shared/fleet/server/tasks/auto_install_content_packages_task.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { getInstalledPackages } from '../services/epm/packages';
3131
import { getPrereleaseFromSettings } from '../services/epm/packages/get_prerelease_setting';
3232

3333
export const TYPE = 'fleet:auto-install-content-packages-task';
34-
export const VERSION = '1.0.2';
34+
export const VERSION = '1.0.3';
3535
const TITLE = 'Fleet Auto Install Content Packages Task';
3636
const SCOPE = ['fleet'];
3737
const DEFAULT_INTERVAL = '10m';
@@ -123,7 +123,7 @@ export class AutoInstallContentPackagesTask {
123123
}
124124

125125
private endRun(msg: string = '') {
126-
this.logger.info(`[AutoInstallContentPackagesTask] runTask ended${msg ? ': ' + msg : ''}`);
126+
this.logger.debug(`[AutoInstallContentPackagesTask] runTask ended${msg ? ': ' + msg : ''}`);
127127
}
128128

129129
public runTask = async (taskInstance: ConcreteTaskInstance, core: CoreSetup) => {
@@ -145,7 +145,7 @@ export class AutoInstallContentPackagesTask {
145145
return getDeleteTaskRunResult();
146146
}
147147

148-
this.logger.info(`[runTask()] started`);
148+
this.logger.debug(`[runTask()] started`);
149149

150150
const [coreStart, _startDeps, { packageService }] = (await core.getStartServices()) as any;
151151
const packageClient = packageService.asInternalUser;

x-pack/platform/plugins/shared/fleet/server/tasks/delete_unenrolled_agents_task.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { AGENTS_INDEX } from '../../common/constants';
2626
import { settingsService } from '../services';
2727

2828
export const TYPE = 'fleet:delete-unenrolled-agents-task';
29-
export const VERSION = '1.0.0';
29+
export const VERSION = '1.0.1';
3030
const TITLE = 'Fleet Delete Unenrolled Agents Task';
3131
const SCOPE = ['fleet'];
3232
const INTERVAL = '1h';
@@ -102,7 +102,7 @@ export class DeleteUnenrolledAgentsTask {
102102
}
103103

104104
private endRun(msg: string = '') {
105-
this.logger.info(`[DeleteUnenrolledAgentsTask] runTask ended${msg ? ': ' + msg : ''}`);
105+
this.logger.debug(`[DeleteUnenrolledAgentsTask] runTask ended${msg ? ': ' + msg : ''}`);
106106
}
107107

108108
public async deleteUnenrolledAgents({
@@ -165,7 +165,7 @@ export class DeleteUnenrolledAgentsTask {
165165
return getDeleteTaskRunResult();
166166
}
167167

168-
this.logger.info(`[runTask()] started`);
168+
this.logger.debug(`[runTask()] started`);
169169

170170
const [coreStart] = await core.getStartServices();
171171
const esClient = coreStart.elasticsearch.client.asInternalUser;

x-pack/platform/plugins/shared/fleet/server/tasks/sync_integrations/sync_integrations_task.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { getCustomAssets } from './custom_assets';
3232
import type { SyncIntegrationsData } from './model';
3333

3434
export const TYPE = 'fleet:sync-integrations-task';
35-
export const VERSION = '1.0.5';
35+
export const VERSION = '1.0.6';
3636
const TITLE = 'Fleet Sync Integrations Task';
3737
const SCOPE = ['fleet'];
3838
const DEFAULT_INTERVAL = '5m';
@@ -115,7 +115,7 @@ export class SyncIntegrationsTask {
115115
}
116116

117117
private endRun(msg: string = '') {
118-
this.logger.info(`[SyncIntegrationsTask] runTask ended${msg ? ': ' + msg : ''}`);
118+
this.logger.debug(`[SyncIntegrationsTask] runTask ended${msg ? ': ' + msg : ''}`);
119119
}
120120

121121
public runTask = async (
@@ -135,7 +135,7 @@ export class SyncIntegrationsTask {
135135
return getDeleteTaskRunResult();
136136
}
137137

138-
this.logger.info(`[runTask()] started`);
138+
this.logger.debug(`[runTask()] started`);
139139

140140
if (!canEnableSyncIntegrations()) {
141141
this.logger.debug(`[SyncIntegrationsTask] Remote synced integration cannot be enabled.`);

x-pack/platform/plugins/shared/fleet/server/tasks/unenroll_inactive_agents_task.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { agentPolicyService, auditLoggingService } from '../services';
2929
import type { AgentPolicy } from '../types';
3030

3131
export const TYPE = 'fleet:unenroll-inactive-agents-task';
32-
export const VERSION = '1.0.1';
32+
export const VERSION = '1.0.2';
3333
const TITLE = 'Fleet Unenroll Inactive Agent Task';
3434
const SCOPE = ['fleet'];
3535
const INTERVAL = '10m';
@@ -118,7 +118,7 @@ export class UnenrollInactiveAgentsTask {
118118
}
119119

120120
private endRun(msg: string = '') {
121-
this.logger.info(`[UnenrollInactiveAgentsTask] runTask ended${msg ? ': ' + msg : ''}`);
121+
this.logger.debug(`[UnenrollInactiveAgentsTask] runTask ended${msg ? ': ' + msg : ''}`);
122122
}
123123

124124
public async unenrollInactiveAgents(
@@ -196,7 +196,7 @@ export class UnenrollInactiveAgentsTask {
196196
return getDeleteTaskRunResult();
197197
}
198198

199-
this.logger.info(`[runTask()] started`);
199+
this.logger.debug(`[runTask()] started`);
200200

201201
const [coreStart] = await core.getStartServices();
202202
const esClient = coreStart.elasticsearch.client.asInternalUser;

0 commit comments

Comments
 (0)