Skip to content

Commit bd6a230

Browse files
Merge branch 'master' into test_spaces_permissions
2 parents 3e39e0c + 2de9f44 commit bd6a230

File tree

30 files changed

+601
-212
lines changed

30 files changed

+601
-212
lines changed

docs/settings/dev-settings.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ They are enabled by default.
1414

1515
[cols="2*<"]
1616
|===
17-
| `xpack.grokdebugger.enabled`
17+
| `xpack.grokdebugger.enabled` {ess-icon}
1818
| Set to `true` to enable the <<xpack-grokdebugger,Grok Debugger>>. Defaults to `true`.
1919

2020
|===

docs/settings/monitoring-settings.asciidoc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ For more information, see
3737
monitoring back-end does not run and {kib} stats are not sent to the monitoring
3838
cluster.
3939

40+
a|`monitoring.cluster_alerts.`
41+
`email_notifications.email_address` {ess-icon}
42+
| Specifies the email address where you want to receive cluster alerts.
43+
See <<cluster-alert-email-notifications, email notifications>> for details.
44+
4045
| `monitoring.ui.elasticsearch.hosts`
4146
| Specifies the location of the {es} cluster where your monitoring data is stored.
4247
By default, this is the same as `elasticsearch.hosts`. This setting enables
@@ -85,7 +90,7 @@ These settings control how data is collected from {kib}.
8590
| Set to `true` (default) to enable data collection from the {kib} NodeJS server
8691
for {kib} dashboards to be featured in *{stack-monitor-app}*.
8792

88-
| `monitoring.kibana.collection.interval`
93+
| `monitoring.kibana.collection.interval` {ess-icon}
8994
| Specifies the number of milliseconds to wait in between data sampling on the
9095
{kib} NodeJS server for the metrics that are displayed in the {kib} dashboards.
9196
Defaults to `10000` (10 seconds).
@@ -111,7 +116,7 @@ about configuring {kib}, see
111116
| Set to `false` to hide *{stack-monitor-app}*. The monitoring back-end
112117
continues to run as an agent for sending {kib} stats to the monitoring
113118
cluster. Defaults to `true`.
114-
119+
115120
| `monitoring.ui.logs.index`
116121
| Specifies the name of the indices that are shown on the
117122
<<logs-monitor-page,*Logs*>> page in *{stack-monitor-app}*. The default value
@@ -124,7 +129,7 @@ about configuring {kib}, see
124129
{ref}/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size[Terms Aggregation].
125130
Defaults to `10000`.
126131

127-
| `monitoring.ui.min_interval_seconds`
132+
| `monitoring.ui.min_interval_seconds` {ess-icon}
128133
| Specifies the minimum number of seconds that a time bucket in a chart can
129134
represent. Defaults to 10. If you modify the
130135
`monitoring.ui.collection.interval` in `elasticsearch.yml`, use the same
@@ -143,7 +148,7 @@ container, then Cgroup statistics are not useful.
143148

144149
[cols="2*<"]
145150
|===
146-
| `monitoring.ui.container.elasticsearch.enabled`
151+
| `monitoring.ui.container.elasticsearch.enabled` {ess-icon}
147152
| For {es} clusters that are running in containers, this setting changes the
148153
*Node Listing* to display the CPU utilization based on the reported Cgroup
149154
statistics. It also adds the calculated Cgroup CPU utilization to the

src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export class IndexPattern implements IIndexPattern {
481481
fields: this.mapping.fields._serialize!(this.fields),
482482
fieldFormatMap: this.mapping.fieldFormatMap._serialize!(this.fieldFormatMap),
483483
type: this.type,
484-
typeMeta: this.mapping.typeMeta._serialize!(this.mapping),
484+
typeMeta: this.mapping.typeMeta._serialize!(this.typeMeta),
485485
};
486486
}
487487

test/functional/page_objects/settings_page.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,15 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
282282
await PageObjects.header.waitUntilLoadingHasFinished();
283283
}
284284

285-
async clickIndexPatternLogstash() {
286-
const indexLink = await find.byXPath(`//a[descendant::*[text()='logstash-*']]`);
285+
async clickIndexPatternByName(name: string) {
286+
const indexLink = await find.byXPath(`//a[descendant::*[text()='${name}']]`);
287287
await indexLink.click();
288288
}
289289

290+
async clickIndexPatternLogstash() {
291+
await this.clickIndexPatternByName('logstash-*');
292+
}
293+
290294
async getIndexPatternList() {
291295
await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 });
292296
return await find.allByCssSelector(

x-pack/plugins/ingest_manager/common/constants/agent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const AGENT_TYPE_PERMANENT = 'PERMANENT';
1212
export const AGENT_TYPE_EPHEMERAL = 'EPHEMERAL';
1313
export const AGENT_TYPE_TEMPORARY = 'TEMPORARY';
1414

15+
export const AGENT_POLLING_REQUEST_TIMEOUT_MS = 300000; // 5 minutes
1516
export const AGENT_POLLING_THRESHOLD_MS = 30000;
1617
export const AGENT_POLLING_INTERVAL = 1000;
1718
export const AGENT_UPDATE_LAST_CHECKIN_INTERVAL_MS = 30000;

x-pack/plugins/ingest_manager/server/errors.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ export const getHTTPResponseCode = (error: IngestManagerError): number => {
1717
return 502; // Bad Gateway
1818
}
1919
if (error instanceof PackageNotFoundError) {
20-
return 404;
21-
}
22-
if (error instanceof PackageOutdatedError) {
23-
return 400;
24-
} else {
25-
return 400; // Bad Request
20+
return 404; // Not Found
2621
}
22+
23+
return 400; // Bad Request
2724
};
2825

2926
export class RegistryError extends IngestManagerError {}
27+
export class RegistryConnectionError extends RegistryError {}
28+
export class RegistryResponseError extends RegistryError {}
3029
export class PackageNotFoundError extends IngestManagerError {}
3130
export class PackageOutdatedError extends IngestManagerError {}

x-pack/plugins/ingest_manager/server/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { IngestManagerPlugin } from './plugin';
99
import {
1010
AGENT_POLICY_ROLLOUT_RATE_LIMIT_INTERVAL_MS,
1111
AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL,
12+
AGENT_POLLING_REQUEST_TIMEOUT_MS,
1213
} from '../common';
1314
export { AgentService, ESIndexPatternService, getRegistryUrl } from './services';
1415
export {
@@ -29,7 +30,10 @@ export const config = {
2930
fleet: schema.object({
3031
enabled: schema.boolean({ defaultValue: true }),
3132
tlsCheckDisabled: schema.boolean({ defaultValue: false }),
32-
pollingRequestTimeout: schema.number({ defaultValue: 60000 }),
33+
pollingRequestTimeout: schema.number({
34+
defaultValue: AGENT_POLLING_REQUEST_TIMEOUT_MS,
35+
min: 5000,
36+
}),
3337
maxConcurrentConnections: schema.number({ defaultValue: 0 }),
3438
kibana: schema.object({
3539
host: schema.maybe(

x-pack/plugins/ingest_manager/server/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class IngestManagerPlugin
238238
// we currently only use this global interceptor if fleet is enabled
239239
// since it would run this func on *every* req (other plugins, CSS, etc)
240240
registerLimitedConcurrencyRoutes(core, config);
241-
registerAgentRoutes(router);
241+
registerAgentRoutes(router, config);
242242
registerEnrollmentApiKeyRoutes(router);
243243
registerInstallScriptRoutes({
244244
router,

x-pack/plugins/ingest_manager/server/routes/agent/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ import * as AgentService from '../../services/agents';
4141
import { postNewAgentActionHandlerBuilder } from './actions_handlers';
4242
import { appContextService } from '../../services';
4343
import { postAgentsUnenrollHandler } from './unenroll_handler';
44+
import { IngestManagerConfigType } from '../..';
4445

45-
export const registerRoutes = (router: IRouter) => {
46+
export const registerRoutes = (router: IRouter, config: IngestManagerConfigType) => {
4647
// Get one
4748
router.get(
4849
{
@@ -80,12 +81,22 @@ export const registerRoutes = (router: IRouter) => {
8081
getAgentsHandler
8182
);
8283

84+
const pollingRequestTimeout = config.fleet.pollingRequestTimeout;
8385
// Agent checkin
8486
router.post(
8587
{
8688
path: AGENT_API_ROUTES.CHECKIN_PATTERN,
8789
validate: PostAgentCheckinRequestSchema,
88-
options: { tags: [] },
90+
options: {
91+
tags: [],
92+
...(pollingRequestTimeout
93+
? {
94+
timeout: {
95+
idleSocket: pollingRequestTimeout,
96+
},
97+
}
98+
: {}),
99+
},
89100
},
90101
postAgentCheckinHandler
91102
);

x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ export function agentCheckinStateNewActionsFactory() {
170170
}
171171

172172
const stream$ = agentPolicy$.pipe(
173-
timeout(appContextService.getConfig()?.fleet.pollingRequestTimeout || 0),
173+
timeout(
174+
// Set a timeout 3s before the real timeout to have a chance to respond an empty response before socket timeout
175+
Math.max((appContextService.getConfig()?.fleet.pollingRequestTimeout ?? 0) - 3000, 3000)
176+
),
174177
filter((agentPolicy) => shouldCreateAgentPolicyAction(agent, agentPolicy)),
175178
rateLimiter(),
176179
mergeMap((agentPolicy) => createAgentActionFromAgentPolicy(soClient, agent, agentPolicy)),

0 commit comments

Comments
 (0)