[Security Solution] Cleanup endpoint telemetry#71950
[Security Solution] Cleanup endpoint telemetry#71950michaelolo24 merged 3 commits intoelastic:masterfrom
Conversation
b502aa4 to
bba51b4
Compare
bba51b4 to
9175e9e
Compare
|
|
||
| /** | ||
| * @description this fun | ||
| * @description this function updates the os telemetry. We use the fullName field as the key as it contains the name and version details. |
| savedObjectsClient.find<AgentEventSOAttributes>({ | ||
| // Get the most recent endpoint event. | ||
| type: AGENT_EVENT_SAVED_OBJECT_TYPE, | ||
| filter: `${AGENT_EVENT_SAVED_OBJECT_TYPE}.attributes.agent_id: ${agentId} and ${AGENT_EVENT_SAVED_OBJECT_TYPE}.attributes.message: "${FLEET_ENDPOINT_PACKAGE_CONSTANT}"`, |
There was a problem hiding this comment.
removed that initial agent.id check as it's redundant giving the search and searchFields parameters below
| agentId: string | ||
| ) => | ||
| savedObjectsClient.find<AgentEventSOAttributes>({ | ||
| // Get the most recent endpoint event. |
There was a problem hiding this comment.
@oatkiller, after speaking with @rudolf yesterday, there doesn't seem to be a way we can really batch this. I.e. we cannot say "given a list of agent id's, give me the most recent event for each id".
Thinking about it more, we may be able to say, "give me every event for each of these agent id's using an or in the filter, but that would be a massive response to then filter". This will definitely need perf testing
| endpointTelemetry: EndpointUsage | ||
| ): Promise<EndpointUsage> => { | ||
| const updatedEndpointTelemetry = { ...endpointTelemetry }; | ||
| export const updateEndpointDailyActiveCount = ( |
There was a problem hiding this comment.
@oatkiller, moved the daily count logic here
| if (agentId) { | ||
| let agentEvents; | ||
| try { | ||
| const response = await getLatestFleetEndpointEvent(soClient, agentId); |
There was a problem hiding this comment.
Will gladly take any suggestions people may have on optimizing this, as currently there is the potential for us to make 10000 of these requests if there are that many agents.
| } else if (isAnActiveMalwareState && failedToEnable) { | ||
| updatedPoliciesTracker.malware.failure += 1; | ||
| } | ||
|
|
There was a problem hiding this comment.
Not currently tracking the situation where an endpoint failed to turn the policy off as it's unlikely / not a high priority. Also, since we're in FF, I'm not sure if I can add an additional field to telemetry, @afharo?
There was a problem hiding this comment.
since we're in FF, I'm not sure if I can add an additional field to telemetry, @afharo?
If it's a bug, I guess you can add it. If it isn't, you'll have to wait :)
|
Pinging @elastic/endpoint-data-visibility-team (Team:Endpoint Data Visibility) |
|
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (60 commits) [SIEM][Detection Engine][Lists] Adds list permissions (elastic#72335) [SIEM][Detection Engine][Lists] Adds conflict versioning and io-ts improvements to lists (elastic#72337) [Resolver] no longer pass related event stats to process node component (elastic#72435) Revert "skip flaky suite (elastic#72146)" [Security Solution] Cleanup endpoint telemetry (elastic#71950) Unskip dashboard embeddable rendering tests (elastic#71824) [ENDPOINT] Added unerolling status for host. (elastic#72303) [Alerting][Connectors] Increase the size of the logos (elastic#72419) [SECURITY] [Timeline] Raw events not displayed (elastic#72387) [ML] Fixes display of regression stop stats if one is NaN (elastic#72412) [Ingest Pipelines] Processor Editor Move Tooltip (elastic#72239) Fix match phrase and not match phrase comparators (elastic#71850) [Plugin Generator] Generate tsconfig and useDefaultBehaviors (elastic#72040) [Security Solution][Timeline] Fix timeline styling and createFrom beh… (elastic#72152) [Resolver] Selector performance (elastic#72380) [Ingest Manager] Set `_meta` in the index.mappings (elastic#72026) [Ingest Manager] Do not bumb config revision during config creation (elastic#72270) [ML] Adding missing index pattern name to new job wizards (elastic#72400) [ML] improve annotation flyout performance (elastic#72299) [APM] Testing error rate API and restructuring folders (elastic#72257) ...
* master: (26 commits) [SIEM][Detection Engine][Lists] Adds list permissions (elastic#72335) [SIEM][Detection Engine][Lists] Adds conflict versioning and io-ts improvements to lists (elastic#72337) [Resolver] no longer pass related event stats to process node component (elastic#72435) Revert "skip flaky suite (elastic#72146)" [Security Solution] Cleanup endpoint telemetry (elastic#71950) Unskip dashboard embeddable rendering tests (elastic#71824) [ENDPOINT] Added unerolling status for host. (elastic#72303) [Alerting][Connectors] Increase the size of the logos (elastic#72419) [SECURITY] [Timeline] Raw events not displayed (elastic#72387) [ML] Fixes display of regression stop stats if one is NaN (elastic#72412) [Ingest Pipelines] Processor Editor Move Tooltip (elastic#72239) Fix match phrase and not match phrase comparators (elastic#71850) [Plugin Generator] Generate tsconfig and useDefaultBehaviors (elastic#72040) [Security Solution][Timeline] Fix timeline styling and createFrom beh… (elastic#72152) [Resolver] Selector performance (elastic#72380) [Ingest Manager] Set `_meta` in the index.mappings (elastic#72026) [Ingest Manager] Do not bumb config revision during config creation (elastic#72270) [ML] Adding missing index pattern name to new job wizards (elastic#72400) [ML] improve annotation flyout performance (elastic#72299) [APM] Testing error rate API and restructuring folders (elastic#72257) ...
…feature-privileges * alerting/consumer-based-rbac: (45 commits) fixed alerts test [SIEM][Detection Engine][Lists] Adds list permissions (elastic#72335) [SIEM][Detection Engine][Lists] Adds conflict versioning and io-ts improvements to lists (elastic#72337) [Resolver] no longer pass related event stats to process node component (elastic#72435) Revert "skip flaky suite (elastic#72146)" [Security Solution] Cleanup endpoint telemetry (elastic#71950) Unskip dashboard embeddable rendering tests (elastic#71824) [ENDPOINT] Added unerolling status for host. (elastic#72303) [Alerting][Connectors] Increase the size of the logos (elastic#72419) [SECURITY] [Timeline] Raw events not displayed (elastic#72387) [ML] Fixes display of regression stop stats if one is NaN (elastic#72412) [Ingest Pipelines] Processor Editor Move Tooltip (elastic#72239) Fix match phrase and not match phrase comparators (elastic#71850) [Plugin Generator] Generate tsconfig and useDefaultBehaviors (elastic#72040) [Security Solution][Timeline] Fix timeline styling and createFrom beh… (elastic#72152) allow user to disable alert even if they dont have privileges to the underlying action [Resolver] Selector performance (elastic#72380) [Ingest Manager] Set `_meta` in the index.mappings (elastic#72026) [Ingest Manager] Do not bumb config revision during config creation (elastic#72270) [ML] Adding missing index pattern name to new job wizards (elastic#72400) ...
Summary
This PR is to improve the logic for endpoint usage telemetry.
savedObjectsrequests to only require the necessary details for our telemetryChecklist
For maintainers