Skip to content

[Synthetics] Schema configuration and Server side changes for CCS settings#262497

Merged
mgiota merged 59 commits intoelastic:mainfrom
mgiota:ccs/types-and-settings-api
Apr 16, 2026
Merged

[Synthetics] Schema configuration and Server side changes for CCS settings#262497
mgiota merged 59 commits intoelastic:mainfrom
mgiota:ccs/types-and-settings-api

Conversation

@mgiota
Copy link
Copy Markdown
Contributor

@mgiota mgiota commented Apr 10, 2026

Closes #259264
Closes #259265
Closes #259266
Closes #259267
Closes #259269

Summary

Screenshot 2026-04-15 at 16 07 36

Add runtime type definitions for cross-cluster search (CCS) settings
and remote monitor info, in preparation for federated views support.

Closes elastic#259264
@mgiota mgiota requested a review from a team as a code owner April 10, 2026 11:10
@mgiota mgiota self-assigned this Apr 10, 2026
@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Apr 10, 2026
@mgiota mgiota added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Apr 10, 2026
@mgiota mgiota changed the title Define CCS settings and remote monitor io-ts types [Synthetics] Define CCS settings and remote monitor io-ts types Apr 10, 2026
@mgiota mgiota marked this pull request as draft April 10, 2026 11:12
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 10, 2026

Approvability

Verdict: Needs human review

This PR introduces a new Cross-Cluster Search (CCS) feature for Synthetics, including new UI settings, schema changes, and modifications to how ES queries are constructed to potentially include remote cluster indices. The significant scope of new functionality and unresolved architectural questions from reviewers warrant human review.

You can customize Macroscope's approvability policy. Learn more.

mgiota added 2 commits April 10, 2026 16:13
Implement the persistence and server-side integration layer for
cross-cluster search support: settings saved object with per-space
isolation, repository, GET/PUT API routes, index resolution service,
and route wrapper wiring gated behind experimental.ccs.enabled flag.

Closes elastic#259265
@mgiota mgiota marked this pull request as ready for review April 10, 2026 14:19
@mgiota mgiota requested a review from a team as a code owner April 10, 2026 14:19
@mgiota mgiota requested a review from elena-shostak April 10, 2026 14:19
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner April 10, 2026 14:40
mgiota and others added 6 commits April 11, 2026 00:29
Wire remoteKibanaUrls through RouteContext so route handlers can resolve
deep links to remote Kibana instances. Add remote_result_utils with
helpers to detect CCS index names and build RemoteMonitorInfo, and extend
PingType and OverviewStatusMetaData with an optional remote field.
@mgiota mgiota changed the title [Synthetics] Define CCS settings and remote monitor io-ts types [Synthetics] Schema configuration and Server side changes for CCS settings Apr 10, 2026
mgiota and others added 4 commits April 11, 2026 02:35
Thread remoteKibanaUrls into queryPings and attach remote monitor info
to each ping based on its _index field. Verified get_journey_steps and
get_certs work with CCS indices as-is. Overview status remote monitor
visibility deferred to the UI phase.
…tic#259269)

Add a "Remote Clusters" tab to the Settings page (stateful only) with
controls for selecting remote clusters and configuring Kibana URLs for
deep linking. Includes toggle for all clusters, combo box for specific
selection, and a full-width URL mapping table per cluster.
mgiota and others added 6 commits April 15, 2026 00:39
The remote monitor detection logic in processOverviewStatus (building
localMonitorIds Set, scanning statusData for unmatched IDs, and calling
getRemoteMonitorDetails) was running unconditionally on every overview
status request, even when CCS was disabled. This added unnecessary
processing on a hot path and contributed to OOM failures in CI tests
that create large datasets (15k buckets).

Wrap the entire block in the same isCCSEnabled check already used by
getEsDataFilters, so the work is only done when CCS is actually active.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ination test

Extract SUMMARIES_PAGE_SIZE to a separate constants module so the test
can mock it to a small value (10 instead of 5000) and eliminate
the OOM crash in CI Jest shard 1/3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mgiota mgiota force-pushed the ccs/types-and-settings-api branch from 0407ae2 to 190913f Compare April 15, 2026 06:14
@shahzad31
Copy link
Copy Markdown
Contributor

@mgiota for kibana url we should index it via fields api to synthetics data automatically when monitor is being created for private locations and for public location when sync is happening

i think this UI would be a burden for users

image

@legrego legrego removed request for a team and elena-shostak April 15, 2026 13:07
@mgiota
Copy link
Copy Markdown
Contributor Author

mgiota commented Apr 15, 2026

@shahzad31 I removed remoteKibanaUrls changes from current PR in this commit. I will handle kibanaRemoteUrls separately in this issue

Screenshot 2026-04-15 at 16 07 36

@mgiota mgiota requested a review from shahzad31 April 15, 2026 13:12
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
synthetics 1278 1283 +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
synthetics 1.1MB 1.1MB +5.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
synthetics 28.9KB 29.2KB +269.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
synthetics 59 60 +1

Total ESLint disabled count

id before after diff
synthetics 64 65 +1

History

cc @mgiota

@mgiota
Copy link
Copy Markdown
Contributor Author

mgiota commented Apr 15, 2026

@shahzad31 CI is finally green. I started an initial attempt to index kibanaUrl in this draft WIP PR. Let me know if we can merge current PR.

Comment on lines +49 to +54
method: 'PUT',
path: SYNTHETICS_API_URLS.CCS_SETTINGS,
validate: {
body: CCSSettingsSchema,
},
writeAccess: true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am double minded on this one as well, if we need a separate route here, i guess since we are using existing settings object, probably makes sense to use that

Copy link
Copy Markdown
Contributor Author

@mgiota mgiota Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep makes sense, I removed separate route in this commit. I see you already approved, I have one more question. The current dynamic_settings.ts route has no serverless guard. It will happily persist useAllRemoteClusters/selectedRemoteClusters to the saved object even in serverless mode.

In practice this is low risk, since the UI hides the entire Remote Clusters tab when isServerless || !isCCSEnabled. However if we want to hard block the PUT in serverless, we'd need to add a serverless guard inside dynamic_settings.ts for the CCS-specific fields. Is the UI + query-path gating sufficient or we should add that guard (could be follow up)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merge now that CI is green and we address things as follow ups

Comment on lines +52 to +65
let heartbeatIndices = SYNTHETICS_INDEX_PATTERN;
if (isCCSEnabled(server)) {
try {
const dynamicSettings = await getSyntheticsDynamicSettings(savedObjectsClient);
const ccsSettings = {
useAllRemoteClusters: dynamicSettings.useAllRemoteClusters ?? false,
selectedRemoteClusters: dynamicSettings.selectedRemoteClusters ?? [],
};
const { indices } = await getSyntheticsIndices(esClient.asCurrentUser, ccsSettings);
heartbeatIndices = indices;
} catch (e) {
server.logger.warn(`Failed to resolve CCS indices, falling back to local: ${e.message}`);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if it's worth caching this, since this is being used against all routes, so it will also impacts the routes which are for example simple routes like creating a monitor or editing a monitor, perhaps create a follow up issue to apply this only where this is required?

other way might be to make it a service like a funciton which gets called getHeartbeatIndices() and pass that, that way it will be only called when its being used in the route.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth caching this

Yep I had that in my todo list for a follow up.

Copy link
Copy Markdown
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only two remaining comments and we should be good to go

Copy link
Copy Markdown
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !!

@mgiota mgiota merged commit c980e80 into elastic:main Apr 16, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes v9.5.0

Projects

None yet

6 participants