Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds telemetry support to alerting and actions plugins #49832 #54214

Closed

Conversation

YulNaumenko
Copy link
Contributor

@YulNaumenko YulNaumenko commented Jan 8, 2020

Summary

#49832

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

…lemetry-kpi-beta

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@YulNaumenko YulNaumenko added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.6.0 Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jan 8, 2020
@YulNaumenko YulNaumenko self-assigned this Jan 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@YulNaumenko YulNaumenko requested a review from Bamieh January 10, 2020 01:58
Copy link
Member

@Bamieh Bamieh left a comment

Choose a reason for hiding this comment

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

Code changes LGTM! I did not pull the code locally to test the usage object.

@pmuellr
Copy link
Member

pmuellr commented Jan 11, 2020

title for this PR should be more descriptive: "adds telemetry support to alerting and actions plugins"

@YulNaumenko YulNaumenko changed the title Telemetry & KPI's for beta, to be defined #49832 Adds telemetry support to alerting and actions plugins #49832 Jan 11, 2020
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

I think the way this is written it will work correctly (or close enough) even with a set of Kibana servers, but it seems very expensive as we'll be making multiple SO calls for every execution just to update the telemetry counter. Shouldn't these be batched and the SO updated every couple of minutes, instead of when the action executions happen?

But I don't know. Maybe this is the way all the other plugins work, and the overhead with the SO calls isn't that bad?

});
}

export async function incrementActionExecutionsCount(
Copy link
Member

Choose a reason for hiding this comment

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

It seems very expensive to make this call on every action execution, as it's making 3 SO calls in the function. Is there a pattern where incrementActionExecutionsCount() would just update a local object in the Kibana server, and then every 30 minutes or so update the SO? Not sure how other plugins do this.

let executionsByActionTypes = {};

try {
const { attributes } = (await savedObjectsClient.get(
Copy link
Member

Choose a reason for hiding this comment

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

It seems like there's a race condition here - shouldn't storeActionsTelemetry() use optimistic concurrency to update the SO? It doesn't seem like it does. Maybe for telemetry we don't care that much if it's off by a little?

@gmmorris
Copy link
Contributor

@elasticmachine merge upstream

elasticmachine and others added 5 commits January 13, 2020 08:43
…lemetry-kpi-beta

# Conflicts:
#	x-pack/legacy/plugins/alerting/server/task_runner/task_runner.ts
…lemetry-kpi-beta

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@LeeDr
Copy link

LeeDr commented Jan 22, 2020

Since we're past feature freeze for v7.6.0 this PR should be bumped to v7.7.0

@YulNaumenko YulNaumenko added v7.7.0 and removed v7.6.0 labels Jan 22, 2020
@YulNaumenko YulNaumenko deleted the alerts-actions-telemetry-kpi-beta branch February 25, 2020 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Actions Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants