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

[operations] Track changes to important metrics in CI builds #65504

Closed
4 tasks done
spalger opened this issue May 6, 2020 · 2 comments
Closed
4 tasks done

[operations] Track changes to important metrics in CI builds #65504

spalger opened this issue May 6, 2020 · 2 comments
Assignees
Labels
Meta Team:Operations Team label for Operations Team

Comments

@spalger
Copy link
Contributor

spalger commented May 6, 2020

In 7.7 we had a bit of a fiasco when we realized how large all of the bundles had grown all of the sudden, and we really want to make it easier to spot the changes which lead up to the bundle sizes increasing dramatically on a pr-by-pr basis.

To do this we want to start tracking high-level metrics in an external service like the following:

  • size of artifacts loaded on the home page
  • number of modules in each KP bundle
  • number of files in the distributables
  • size of distributables

Additionally, we want to automatically notify PR authors when their PR effects those metrics in a way that the PR author can act on.

At some point we would ideally require sign off when changes to the metrics are large enough, but we will probably need to collect data for a while before we add additional hurdles in front of contributors getting code into the repo.

Current tasks:


The initial version of this metrics reporting is already in the repo: create a CiStatsReporter and call reporter.metric() to record a metric for the current CI build. Calls to this method when the CiStatsReporter context is not available in the environment will be a noop.

Here is an example of what we track for each build:

{
  "jenkinsJobName": "elastic+kibana+pipeline-pull-request",
  "jenkinsJobId": "45975",
  "prId": "65177",
  "startedAt": "2020-05-06T14:10:18.660Z",
  "branch": "backport/7.x/pr-63473",
  "commit": "88f12f3645c9db7db51aacacda805fa124486c72",
  "targetBranch": "7.x",
  "mergeBase": "3122a1497579b0e3da9eb2b606babdc7fb529f65",
  "completedAt": "2020-05-06T16:09:13.803Z",
  "result": "SUCCESS"
}

When a metric() call is executed the following is recorded as well:

{
  "name": "@kbn/optimizer bundle module count",
  "subName": "core",
  "value": 279,
  "buildId": "f546075f-1a47-4a31-8e80-28d69e2a8f27"
}

(we're planning to rename "name" to "group", and "subName" to "metricName")

The intention behind this design is to make it easy to produce a table like below that can be logged on a PR:

@kbn/optimizer bundle module count

Name Value Change from 3122a14
core 279 +55
data 1258 +0
canvas 549 +0

Additionally, to make this data easier to run ad-hoc visualizations on in the kibana-stats cluster, we plan to create summary documents that combine the data from the build documents and all the metric documents that will be stored in the kibana-stats cluster.

@spalger spalger added discuss Team:Operations Team label for Operations Team labels May 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger
Copy link
Contributor Author

spalger commented Jul 10, 2020

@spalger spalger closed this as completed Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

2 participants