Skip to content

Commit ab6f7c6

Browse files
criamicoelasticmachinekibanamachine
authored
[Fleet] Create API to report status of integrations synchronization (elastic#216178)
Closes elastic#192363 ## Summary Add endpoint that compares integrations installed on remote cluster with integrations in ccr index `fleet-synced-integrations-ccr-<outputId>`. Feature flag: `enableSyncIntegrationsOnRemote` - Use the [ccr info api](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html) to check that the ccr index is active - Compare the content of the two indices and report the sync status for each integration: ``` GET kbn:/api/fleet/remote_synced_integrations/status { "integrations": [ { "package_name": "akamai", "package_version": "2.28.0", "updated_at": "2025-03-27T10:29:52.485Z", "sync_status": true }, { "package_name": "auth0", "package_version": "1.21.0", "updated_at": "2025-03-26T12:06:26.268Z", "sync_status": false, "error": "Installation status: not_installed" }, ] ``` - Check that the integrations have custom assets and report their sync status (follow up of elastic#215504) ### Testing Setup local env with the guide added in dev_docs ([preview](https://github.com/elastic/kibana/blob/b438a719ee34d0dfb19a7a6cbbafc616936581bb/x-pack/platform/plugins/shared/fleet/dev_docs/local_setup/remote_clusters_ccr.md)) - Install some integrations on local cluster, wait that they are synced on remote - From remote cluster dev tools, run ``` GET kbn:/api/fleet/remote_synced_integrations/status ``` - To verify that custom assets are synced choose an integration, for instance `system` - From the package policy select a var, advanced options and add a custom mapping and a custom pipeline. In my example I used `system` <img width="1195" alt="Screenshot 2025-04-01 at 11 18 40" src="https://github.com/user-attachments/assets/c339d6f0-4404-4e9b-b489-7b37977f201b" /> - Run the endpoint again and you should see the status of custom assets too: ``` { "integrations": [ { "package_name": "akamai", "package_version": "2.28.0", "updated_at": "2025-03-27T10:29:52.485Z", "sync_status": "completed" }, { "package_name": "elastic_agent", "package_version": "2.2.0", "updated_at": "2025-03-26T14:06:29.216Z", "sync_status": "completed" }, { "package_name": "synthetics", "package_version": "1.4.1", "updated_at": "2025-03-26T14:06:31.909Z", "sync_status": "completed" }, { "package_name": "system", "package_version": "1.67.3", "updated_at": "2025-03-28T10:08:00.602Z", "sync_status": "completed" } ], "custom_assets": { "component_template:logs-system.auth@custom": { "name": "logs-system.auth@custom", "type": "component_template", "package_name": "system", "package_version": "1.67.3", "sync_status": "completed" }, "ingest_pipeline:logs-system.auth@custom": { "name": "logs-system.auth@custom", "type": "ingest_pipeline", "package_name": "system", "package_version": "1.67.3", "sync_status": "completed" } } } ``` ### Checklist - [ ] [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 --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]>
1 parent 87b3816 commit ab6f7c6

File tree

23 files changed

+2382
-45
lines changed

23 files changed

+2382
-45
lines changed

oas_docs/bundle.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43640,6 +43640,138 @@
4364043640
]
4364143641
}
4364243642
},
43643+
"/api/fleet/remote_synced_integrations/status": {
43644+
"get": {
43645+
"description": "[Required authorization] Route required privileges: fleet-settings-read AND integrations-read.",
43646+
"operationId": "get-fleet-remote-synced-integrations-status",
43647+
"parameters": [],
43648+
"responses": {
43649+
"200": {
43650+
"content": {
43651+
"application/json": {
43652+
"schema": {
43653+
"additionalProperties": false,
43654+
"properties": {
43655+
"custom_assets": {
43656+
"additionalProperties": {
43657+
"additionalProperties": false,
43658+
"properties": {
43659+
"name": {
43660+
"type": "string"
43661+
},
43662+
"package_name": {
43663+
"type": "string"
43664+
},
43665+
"package_version": {
43666+
"type": "string"
43667+
},
43668+
"sync_status": {
43669+
"enum": [
43670+
"completed",
43671+
"synchronizing",
43672+
"failed"
43673+
],
43674+
"type": "string"
43675+
},
43676+
"type": {
43677+
"type": "string"
43678+
}
43679+
},
43680+
"required": [
43681+
"type",
43682+
"name",
43683+
"package_name",
43684+
"package_version",
43685+
"sync_status"
43686+
],
43687+
"type": "object"
43688+
},
43689+
"type": "object"
43690+
},
43691+
"error": {
43692+
"type": "string"
43693+
},
43694+
"integrations": {
43695+
"items": {
43696+
"additionalProperties": false,
43697+
"properties": {
43698+
"error": {
43699+
"type": "string"
43700+
},
43701+
"id": {
43702+
"type": "string"
43703+
},
43704+
"package_name": {
43705+
"type": "string"
43706+
},
43707+
"package_version": {
43708+
"type": "string"
43709+
},
43710+
"sync_status": {
43711+
"enum": [
43712+
"completed",
43713+
"synchronizing",
43714+
"failed"
43715+
],
43716+
"type": "string"
43717+
},
43718+
"updated_at": {
43719+
"type": "string"
43720+
}
43721+
},
43722+
"required": [
43723+
"sync_status"
43724+
],
43725+
"type": "object"
43726+
},
43727+
"type": "array"
43728+
}
43729+
},
43730+
"required": [
43731+
"integrations"
43732+
],
43733+
"type": "object"
43734+
}
43735+
}
43736+
}
43737+
},
43738+
"400": {
43739+
"content": {
43740+
"application/json": {
43741+
"schema": {
43742+
"additionalProperties": false,
43743+
"description": "Generic Error",
43744+
"properties": {
43745+
"attributes": {},
43746+
"error": {
43747+
"type": "string"
43748+
},
43749+
"errorType": {
43750+
"type": "string"
43751+
},
43752+
"message": {
43753+
"type": "string"
43754+
},
43755+
"statusCode": {
43756+
"type": "number"
43757+
}
43758+
},
43759+
"required": [
43760+
"message",
43761+
"attributes"
43762+
],
43763+
"type": "object"
43764+
}
43765+
}
43766+
}
43767+
}
43768+
},
43769+
"summary": "Get CCR Remote synced integrations status",
43770+
"tags": [
43771+
"CCR Remote synced integrations"
43772+
]
43773+
}
43774+
},
4364343775
"/api/fleet/service_tokens": {
4364443776
"post": {
4364543777
"description": "[Required authorization] Route required privileges: fleet-agents-all.",
@@ -54354,6 +54486,9 @@
5435454486
{
5435554487
"name": "alerting"
5435654488
},
54489+
{
54490+
"name": "CCR Remote synced integrations"
54491+
},
5435754492
{
5435854493
"name": "connectors"
5435954494
},

oas_docs/bundle.serverless.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43640,6 +43640,138 @@
4364043640
]
4364143641
}
4364243642
},
43643+
"/api/fleet/remote_synced_integrations/status": {
43644+
"get": {
43645+
"description": "[Required authorization] Route required privileges: fleet-settings-read AND integrations-read.",
43646+
"operationId": "get-fleet-remote-synced-integrations-status",
43647+
"parameters": [],
43648+
"responses": {
43649+
"200": {
43650+
"content": {
43651+
"application/json": {
43652+
"schema": {
43653+
"additionalProperties": false,
43654+
"properties": {
43655+
"custom_assets": {
43656+
"additionalProperties": {
43657+
"additionalProperties": false,
43658+
"properties": {
43659+
"name": {
43660+
"type": "string"
43661+
},
43662+
"package_name": {
43663+
"type": "string"
43664+
},
43665+
"package_version": {
43666+
"type": "string"
43667+
},
43668+
"sync_status": {
43669+
"enum": [
43670+
"completed",
43671+
"synchronizing",
43672+
"failed"
43673+
],
43674+
"type": "string"
43675+
},
43676+
"type": {
43677+
"type": "string"
43678+
}
43679+
},
43680+
"required": [
43681+
"type",
43682+
"name",
43683+
"package_name",
43684+
"package_version",
43685+
"sync_status"
43686+
],
43687+
"type": "object"
43688+
},
43689+
"type": "object"
43690+
},
43691+
"error": {
43692+
"type": "string"
43693+
},
43694+
"integrations": {
43695+
"items": {
43696+
"additionalProperties": false,
43697+
"properties": {
43698+
"error": {
43699+
"type": "string"
43700+
},
43701+
"id": {
43702+
"type": "string"
43703+
},
43704+
"package_name": {
43705+
"type": "string"
43706+
},
43707+
"package_version": {
43708+
"type": "string"
43709+
},
43710+
"sync_status": {
43711+
"enum": [
43712+
"completed",
43713+
"synchronizing",
43714+
"failed"
43715+
],
43716+
"type": "string"
43717+
},
43718+
"updated_at": {
43719+
"type": "string"
43720+
}
43721+
},
43722+
"required": [
43723+
"sync_status"
43724+
],
43725+
"type": "object"
43726+
},
43727+
"type": "array"
43728+
}
43729+
},
43730+
"required": [
43731+
"integrations"
43732+
],
43733+
"type": "object"
43734+
}
43735+
}
43736+
}
43737+
},
43738+
"400": {
43739+
"content": {
43740+
"application/json": {
43741+
"schema": {
43742+
"additionalProperties": false,
43743+
"description": "Generic Error",
43744+
"properties": {
43745+
"attributes": {},
43746+
"error": {
43747+
"type": "string"
43748+
},
43749+
"errorType": {
43750+
"type": "string"
43751+
},
43752+
"message": {
43753+
"type": "string"
43754+
},
43755+
"statusCode": {
43756+
"type": "number"
43757+
}
43758+
},
43759+
"required": [
43760+
"message",
43761+
"attributes"
43762+
],
43763+
"type": "object"
43764+
}
43765+
}
43766+
}
43767+
}
43768+
},
43769+
"summary": "Get CCR Remote synced integrations status",
43770+
"tags": [
43771+
"CCR Remote synced integrations"
43772+
]
43773+
}
43774+
},
4364343775
"/api/fleet/service_tokens": {
4364443776
"post": {
4364543777
"description": "[Required authorization] Route required privileges: fleet-agents-all.",
@@ -53945,6 +54077,9 @@
5394554077
{
5394654078
"name": "alerting"
5394754079
},
54080+
{
54081+
"name": "CCR Remote synced integrations"
54082+
},
5394854083
{
5394954084
"name": "connectors"
5395054085
},

0 commit comments

Comments
 (0)