Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
fbddcd7
Set refresh interval to 1ms
dgieselaar Aug 21, 2025
99ec827
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Aug 21, 2025
cbaaf0b
Add references
dgieselaar Aug 21, 2025
2dacd23
Merge branch 'refresh-interval-1ms' of github.com:dgieselaar/kibana i…
dgieselaar Aug 21, 2025
9dcbc1d
use explicit any
dgieselaar Aug 21, 2025
b547da1
Disable pre-ftr steps temporarily
dgieselaar Aug 21, 2025
378849a
Make sure Kibana gets built
dgieselaar Aug 21, 2025
b829f28
Re-enable steps
dgieselaar Aug 22, 2025
32ddf66
Allow updating refresh_interval on serverless
dgieselaar Aug 22, 2025
32f5f60
Remove console.log statement
dgieselaar Aug 22, 2025
9677f3d
Don't use global index template
dgieselaar Aug 22, 2025
4f96606
Merge branch 'main' of github.com:elastic/kibana into refresh-interva…
dgieselaar Aug 22, 2025
61b5f7e
Some config fixes
dgieselaar Aug 23, 2025
9cf11e1
Safer override of refresh interval for indx templates
dgieselaar Aug 23, 2025
c8251c4
Make sure Journeys can run
dgieselaar Aug 23, 2025
10cd8db
Revert change in config-loader
dgieselaar Aug 23, 2025
5feab00
Pass in empty argv
dgieselaar Aug 23, 2025
9795674
Merge branch 'main' into refresh-interval-1ms
klacabane Oct 2, 2025
0bcc196
configurable refresh interval
klacabane Oct 7, 2025
d866037
override for few test suites
klacabane Oct 7, 2025
b1237eb
Merge branch 'main' into refresh-interval-1ms
klacabane Oct 7, 2025
9ac0827
override more configs
klacabane Oct 7, 2025
809d2e8
Make sure refresh_interval.override=true is always set
dgieselaar Oct 7, 2025
adb2e64
fix alerting
klacabane Oct 9, 2025
06e7160
basic license test
klacabane Oct 9, 2025
f6d105e
complete tier license test
klacabane Oct 9, 2025
e341c17
fleet tests
klacabane Oct 9, 2025
ea763a7
log correlation test
klacabane Oct 9, 2025
4622e39
override some configs
klacabane Oct 9, 2025
c12275d
Merge branch 'main' into refresh-interval-1ms
klacabane Oct 9, 2025
5a05f81
revert apm.getConfigFilePaths change
klacabane Oct 9, 2025
8364522
remove apm
klacabane Oct 9, 2025
c6ec714
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Oct 9, 2025
3438d2a
newline
klacabane Oct 9, 2025
2d94c50
remove esarchive apm
klacabane Oct 9, 2025
b1e9845
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 9, 2025
164ba35
Merge branch 'main' into refresh-interval-1ms
klacabane Oct 9, 2025
0e8c470
revert alert api changes
klacabane Oct 9, 2025
987a885
bump refresh interval to 2s
klacabane Oct 9, 2025
ce3c797
option to disable custom refresh interval
klacabane Oct 10, 2025
dddbff3
disable for license_complete_tier config
klacabane Oct 10, 2025
a864504
fix infra test
klacabane Oct 10, 2025
0af6214
Remove APM-specific things and remove rule-related settings
dgieselaar Oct 10, 2025
e70f2e6
config overrides
klacabane Oct 10, 2025
f0c2161
Make sure legacy request format is handled for putIndexTemplate
dgieselaar Oct 10, 2025
02fe86b
Merge branch 'refresh-interval-1ms' of github.com:dgieselaar/kibana i…
dgieselaar Oct 10, 2025
d219a7f
Remove refreshInterval override
dgieselaar Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/check_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ source .buildkite/scripts/common/util.sh
.buildkite/scripts/bootstrap.sh

echo --- Check Types
node scripts/type_check
# node scripts/type_check
72 changes: 36 additions & 36 deletions .buildkite/scripts/steps/checks/capture_oas_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/setup_es_snapshot_cache.sh

echo --- Capture OAS snapshot
cmd="node scripts/capture_oas_snapshot \
--include-path /api/status \
--include-path /api/alerting/rule/ \
--include-path /api/alerting/rules \
--include-path /api/actions \
--include-path /api/security/role \
--include-path /api/spaces \
--include-path /api/streams \
--include-path /api/fleet \
--include-path /api/saved_objects/_import \
--include-path /api/saved_objects/_export \
--include-path /api/maintenance_window \
--include-path /api/agent_builder"
if is_pr && ! is_auto_commit_disabled; then
cmd="$cmd --update"
fi

if [[ $BUILDKITE_PULL_REQUEST != "false" && "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" != "main" ]] || [[ $BUILDKITE_PULL_REQUEST == "false" && "$BUILDKITE_BRANCH" != "main" ]]; then
cmd="$cmd --no-serverless"
fi

run_check() {
eval "$cmd"
node ./scripts/validate_oas_docs.js --assert-no-error-increase --skip-printing-issues --update-baseline
}

retry 5 15 run_check

check_for_changed_files "$cmd" true

.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh
.buildkite/scripts/steps/openapi_bundling/final_merge.sh
# .buildkite/scripts/bootstrap.sh
# .buildkite/scripts/setup_es_snapshot_cache.sh

# echo --- Capture OAS snapshot
# cmd="node scripts/capture_oas_snapshot \
# --include-path /api/status \
# --include-path /api/alerting/rule/ \
# --include-path /api/alerting/rules \
# --include-path /api/actions \
# --include-path /api/security/role \
# --include-path /api/spaces \
# --include-path /api/streams \
# --include-path /api/fleet \
# --include-path /api/saved_objects/_import \
# --include-path /api/saved_objects/_export \
# --include-path /api/maintenance_window \
# --include-path /api/agent_builder"
# if is_pr && ! is_auto_commit_disabled; then
# cmd="$cmd --update"
# fi

# if [[ $BUILDKITE_PULL_REQUEST != "false" && "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" != "main" ]] || [[ $BUILDKITE_PULL_REQUEST == "false" && "$BUILDKITE_BRANCH" != "main" ]]; then
# cmd="$cmd --no-serverless"
# fi

# run_check() {
# eval "$cmd"
# node ./scripts/validate_oas_docs.js --assert-no-error-increase --skip-printing-issues --update-baseline
# }

# retry 5 15 run_check

# check_for_changed_files "$cmd" true

# .buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh
# .buildkite/scripts/steps/openapi_bundling/final_merge.sh
58 changes: 29 additions & 29 deletions .buildkite/scripts/steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh

echo '--- Lint: stylelint'
node scripts/stylelint
echo "stylelint ✅"

echo '--- Lint: eslint'
# disable "Exit immediately" mode so that we can run eslint, capture it's exit code, and respond appropriately
# after possibly commiting fixed files to the repo
set +e;
if is_pr && ! is_auto_commit_disabled; then
desc="node scripts/eslint_all_files --no-cache --fix"
node scripts/eslint_all_files --no-cache --fix
else
desc="node scripts/eslint_all_files --no-cache"
node scripts/eslint_all_files --no-cache
fi

eslint_exit=$?
# re-enable "Exit immediately" mode
set -e;

check_for_changed_files "$desc" true

if [[ "${eslint_exit}" != "0" ]]; then
exit 1
fi

echo "eslint ✅"
# .buildkite/scripts/bootstrap.sh

# echo '--- Lint: stylelint'
# node scripts/stylelint
# echo "stylelint ✅"

# echo '--- Lint: eslint'
# # disable "Exit immediately" mode so that we can run eslint, capture it's exit code, and respond appropriately
# # after possibly commiting fixed files to the repo
# set +e;
# if is_pr && ! is_auto_commit_disabled; then
# desc="node scripts/eslint_all_files --no-cache --fix"
# node scripts/eslint_all_files --no-cache --fix
# else
# desc="node scripts/eslint_all_files --no-cache"
# node scripts/eslint_all_files --no-cache
# fi

# eslint_exit=$?
# # re-enable "Exit immediately" mode
# set -e;

# check_for_changed_files "$desc" true

# if [[ "${eslint_exit}" != "0" ]]; then
# exit 1
# fi

# echo "eslint ✅"
8 changes: 4 additions & 4 deletions .buildkite/scripts/steps/lint_with_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
# .buildkite/scripts/bootstrap.sh

echo '--- Lint: eslint (with types)'
export NODE_OPTIONS='--max-old-space-size=8192'
node scripts/eslint_with_types
# echo '--- Lint: eslint (with types)'
# export NODE_OPTIONS='--max-old-space-size=8192'
# node scripts/eslint_with_types
46 changes: 41 additions & 5 deletions src/platform/packages/shared/kbn-es/src/utils/docker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,53 +355,64 @@ describe('resolveEsArgs()', () => {
['foo', 'bar'],
['qux', 'zip'],
];
const refreshOverrideFlag = '-Des.stateless.allow.index.refresh_interval.override=true';
const findEnvValue = (args: string[], key: string) => {
const entry = args.find((value) => value.startsWith(`${key}=`));
return entry ? entry.slice(key.length + 1) : undefined;
};

test('should return default args when no options', () => {
const esArgs = resolveEsArgs(defaultEsArgs, {});

expect(esArgs).toHaveLength(4);
expect(esArgs).toHaveLength(6);
expect(esArgs).toMatchInlineSnapshot(`
Array [
"--env",
"foo=bar",
"--env",
"qux=zip",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});

test('should override default args when options is a string', () => {
const esArgs = resolveEsArgs(defaultEsArgs, { esArgs: 'foo=true' });

expect(esArgs).toHaveLength(4);
expect(esArgs).toHaveLength(6);
expect(esArgs).toMatchInlineSnapshot(`
Array [
"--env",
"foo=true",
"--env",
"qux=zip",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});

test('should override default args when options is an array', () => {
const esArgs = resolveEsArgs(defaultEsArgs, { esArgs: ['foo=false', 'qux=true'] });

expect(esArgs).toHaveLength(4);
expect(esArgs).toHaveLength(6);
expect(esArgs).toMatchInlineSnapshot(`
Array [
"--env",
"foo=false",
"--env",
"qux=true",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});

test('should override defaults args and handle password option', () => {
const esArgs = resolveEsArgs(defaultEsArgs, { esArgs: 'foo=false', password: 'hello' });

expect(esArgs).toHaveLength(6);
expect(esArgs).toHaveLength(8);
expect(esArgs).toMatchInlineSnapshot(`
Array [
"--env",
Expand All @@ -410,14 +421,16 @@ describe('resolveEsArgs()', () => {
"qux=zip",
"--env",
"ELASTIC_PASSWORD=hello",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});

test('should add SSL args when SSL is passed', () => {
const esArgs = resolveEsArgs(defaultEsArgs, { ssl: true });

expect(esArgs).toHaveLength(10);
expect(esArgs).toHaveLength(12);
expect(esArgs).toMatchInlineSnapshot(`
Array [
"--env",
Expand All @@ -430,6 +443,8 @@ describe('resolveEsArgs()', () => {
"xpack.security.http.ssl.keystore.path=/usr/share/elasticsearch/config/certs/elasticsearch.p12",
"--env",
"xpack.security.http.ssl.verification_mode=certificate",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});
Expand Down Expand Up @@ -470,6 +485,8 @@ describe('resolveEsArgs()', () => {
"xpack.security.authc.realms.saml.cloud-saml-kibana.attributes.name=http://saml.elastic-cloud.com/attributes/name",
"--env",
"xpack.security.authc.realms.saml.cloud-saml-kibana.attributes.mail=http://saml.elastic-cloud.com/attributes/email",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});
Expand All @@ -490,6 +507,8 @@ describe('resolveEsArgs()', () => {
"xpack.security.http.ssl.keystore.path=/usr/share/elasticsearch/config/certs/elasticsearch.p12",
"--env",
"xpack.security.http.ssl.verification_mode=certificate",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});
Expand Down Expand Up @@ -533,6 +552,8 @@ describe('resolveEsArgs()', () => {
"xpack.security.authc.realms.saml.cloud-saml-kibana.attributes.name=http://saml.elastic-cloud.com/attributes/name",
"--env",
"xpack.security.authc.realms.saml.cloud-saml-kibana.attributes.mail=http://saml.elastic-cloud.com/attributes/email",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});
Expand Down Expand Up @@ -592,9 +613,24 @@ describe('resolveEsArgs()', () => {
"serverless.universal_iam_service.enabled=true",
"--env",
"serverless.universal_iam_service.url=http://uiam-cosmosdb-gateway:8080",
"--env",
"ES_JAVA_OPTS=-Des.stateless.allow.index.refresh_interval.override=true",
]
`);
});

test('should append refresh interval override when ES_JAVA_OPTS is provided', () => {
const esArgs = resolveEsArgs([], { esArgs: 'ES_JAVA_OPTS=-Xms1g -Xmx1g' });

expect(findEnvValue(esArgs, 'ES_JAVA_OPTS')).toBe(`-Xms1g -Xmx1g ${refreshOverrideFlag}`);
});

test('should not duplicate refresh interval override when already present', () => {
const existingOptions = `-Xms1g -Xmx1g ${refreshOverrideFlag}`;
const esArgs = resolveEsArgs([], { esArgs: `ES_JAVA_OPTS=${existingOptions}` });

expect(findEnvValue(esArgs, 'ES_JAVA_OPTS')).toBe(existingOptions);
});
});

describe('setupServerlessVolumes()', () => {
Expand Down
14 changes: 13 additions & 1 deletion src/platform/packages/shared/kbn-es/src/utils/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import pRetry from 'p-retry';
import { resolve, basename, join } from 'path';
import type { ClientOptions } from '@elastic/elasticsearch';
import { Client, HttpConnection } from '@elastic/elasticsearch';

import type { ToolingLog } from '@kbn/tooling-log';
import { kibanaPackageJson as pkg, REPO_ROOT } from '@kbn/repo-info';
import { CA_CERT_PATH, ES_P12_PASSWORD, ES_P12_PATH } from '@kbn/dev-utils';
Expand Down Expand Up @@ -139,6 +138,9 @@ interface ServerlessEsNodeArgs {
export const DEFAULT_PORT = 9200;
const DOCKER_REGISTRY = 'docker.elastic.co';

const ES_REFRESH_INTERVAL_OVERRIDE_FLAG =
'-Des.stateless.allow.index.refresh_interval.override=true';

const DOCKER_BASE_CMD = [
'run',

Expand Down Expand Up @@ -656,6 +658,16 @@ export function resolveEsArgs(
}
}

const javaOptions = esArgs.get('ES_JAVA_OPTS');
if (javaOptions) {
// Ensure the serverless refresh interval override flag is always present alongside any custom ES_JAVA_OPTS.
if (!javaOptions.includes(ES_REFRESH_INTERVAL_OVERRIDE_FLAG)) {
esArgs.set('ES_JAVA_OPTS', `${javaOptions} ${ES_REFRESH_INTERVAL_OVERRIDE_FLAG}`.trim());
}
} else {
esArgs.set('ES_JAVA_OPTS', ES_REFRESH_INTERVAL_OVERRIDE_FLAG);
}

return Array.from(esArgs).flatMap((e) => ['--env', e.join('=')]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ export async function extractAndArchiveLogs({
'--format',
'{{.Names}}',
]);
nodeNames = nodeNamesString.split('\n').filter(Boolean);
nodeNames = nodeNamesString
.split('\n')
.filter(Boolean)
.filter(
(nodeName) =>
nodeName.includes('elasticsearch') ||
nodeName.includes('es') ||
nodeName.includes('kibana')
);
}

if (!nodeNames.length) {
Expand Down
Loading