mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
# Backport This will backport the following commits from `main` to `8.6`: - [changed agent versions to agents per version telemetry (#147164)](https://github.com/elastic/kibana/pull/147164) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2022-12-07T11:23:30Z","message":"changed agent versions to agents per version telemetry (#147164)\n\n## Summary\r\n\r\nChanged the list of agent versions to agent count per version in\r\nfleet-usages telemetry as requested\r\n[here](https://github.com/elastic/kibana/pull/145353#issuecomment-1331783758).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e771fc8e9fa5f551d8692fc8558e5d7e2cbfef79","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.7.0","v8.6.1"],"number":147164,"url":"https://github.com/elastic/kibana/pull/147164","mergeCommit":{"message":"changed agent versions to agents per version telemetry (#147164)\n\n## Summary\r\n\r\nChanged the list of agent versions to agent count per version in\r\nfleet-usages telemetry as requested\r\n[here](https://github.com/elastic/kibana/pull/145353#issuecomment-1331783758).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e771fc8e9fa5f551d8692fc8558e5d7e2cbfef79"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147164","number":147164,"mergeCommit":{"message":"changed agent versions to agents per version telemetry (#147164)\n\n## Summary\r\n\r\nChanged the list of agent versions to agent count per version in\r\nfleet-usages telemetry as requested\r\n[here](https://github.com/elastic/kibana/pull/145353#issuecomment-1331783758).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e771fc8e9fa5f551d8692fc8558e5d7e2cbfef79"}},{"branch":"8.6","label":"v8.6.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Co-authored-by: Julia Bardi <julia.bardi@elastic.co>
This commit is contained in:
parent
11cde5b883
commit
b91dfc93e3
4 changed files with 19 additions and 11 deletions
|
@ -174,10 +174,10 @@ describe('Add Integration - Real API', () => {
|
|||
setupIntegrations();
|
||||
cy.getBySel(getIntegrationCategories('aws')).click();
|
||||
cy.getBySel(INTEGRATIONS_SEARCHBAR.BADGE).contains('AWS').should('exist');
|
||||
cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 28);
|
||||
cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length.greaterThan', 28);
|
||||
|
||||
cy.getBySel(INTEGRATIONS_SEARCHBAR.INPUT).clear().type('Cloud');
|
||||
cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 3);
|
||||
cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length.greaterThan', 2);
|
||||
cy.getBySel(INTEGRATIONS_SEARCHBAR.REMOVE_BADGE_BUTTON).click();
|
||||
cy.getBySel(INTEGRATIONS_SEARCHBAR.BADGE).should('not.exist');
|
||||
});
|
||||
|
|
|
@ -49,7 +49,10 @@ export const getAgentUsage = async (
|
|||
};
|
||||
|
||||
export interface AgentData {
|
||||
agent_versions: string[];
|
||||
agents_per_version: Array<{
|
||||
version: string;
|
||||
count: number;
|
||||
}>;
|
||||
agent_checkin_status: {
|
||||
error: number;
|
||||
degraded: number;
|
||||
|
@ -58,9 +61,9 @@ export interface AgentData {
|
|||
}
|
||||
|
||||
const DEFAULT_AGENT_DATA = {
|
||||
agent_versions: [],
|
||||
agent_checkin_status: { error: 0, degraded: 0 },
|
||||
agents_per_policy: [],
|
||||
agents_per_version: [],
|
||||
};
|
||||
|
||||
export const getAgentData = async (
|
||||
|
@ -105,8 +108,8 @@ export const getAgentData = async (
|
|||
},
|
||||
{ signal: abortController.signal }
|
||||
);
|
||||
const versions = ((response?.aggregations?.versions as any).buckets ?? []).map(
|
||||
(bucket: any) => bucket.key
|
||||
const agentsPerVersion = ((response?.aggregations?.versions as any).buckets ?? []).map(
|
||||
(bucket: any) => ({ version: bucket.key, count: bucket.doc_count })
|
||||
);
|
||||
const statuses = transformLastCheckinStatusBuckets(response);
|
||||
|
||||
|
@ -115,9 +118,9 @@ export const getAgentData = async (
|
|||
);
|
||||
|
||||
return {
|
||||
agent_versions: versions,
|
||||
agent_checkin_status: statuses,
|
||||
agents_per_policy: agentsPerPolicy,
|
||||
agents_per_version: agentsPerVersion,
|
||||
};
|
||||
} catch (error) {
|
||||
if (error.statusCode === 404) {
|
||||
|
|
|
@ -260,7 +260,10 @@ describe('fleet usage telemetry', () => {
|
|||
num_host_urls: 0,
|
||||
},
|
||||
packages: [],
|
||||
agent_versions: ['8.5.1', '8.6.0'],
|
||||
agents_per_version: [
|
||||
{ version: '8.5.1', count: 1 },
|
||||
{ version: '8.6.0', count: 1 },
|
||||
],
|
||||
agent_checkin_status: { error: 1, degraded: 1 },
|
||||
agents_per_policy: [2],
|
||||
fleet_server_config: {
|
||||
|
|
|
@ -106,11 +106,13 @@ export const fleetUsagesSchema: RootSchema<any> = {
|
|||
},
|
||||
},
|
||||
},
|
||||
agent_versions: {
|
||||
agents_per_version: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'keyword',
|
||||
_meta: { description: 'The agent versions enrolled in this deployment.' },
|
||||
properties: {
|
||||
version: { type: 'keyword' },
|
||||
count: { type: 'long' },
|
||||
},
|
||||
},
|
||||
},
|
||||
agents_per_policy: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue