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

[Monitoring] Usage collection #75878

Merged
merged 35 commits into from
Sep 25, 2020

Conversation

chrisronline
Copy link
Contributor

@chrisronline chrisronline commented Aug 25, 2020

Relates to #73141

This PR adds telemetry data for Stack Monitoring from Kibana.

Here is a sample of the data sent to telemetry, which will most likely need to be transformed (via https://github.com/elastic/infra/issues/23272):

{
  "hasMonitoringData": true,
  "clusters": [
    {
      "clusterUuid": "PChw572_S52efCun1M0eNg",
      "license": "platinum",
      "metricbeatUsed": true,
      "elasticsearch": {
        "count": 1,
        "enabled": true,
        "metricbeatUsed": true
      },
      "kibana": {
        "count": 1,
        "enabled": true,
        "metricbeatUsed": true
      },
      "logstash": {
        "count": 1,
        "enabled": true,
        "metricbeatUsed": true
      },
      "beats": {
        "count": 2,
        "enabled": true,
        "metricbeatUsed": true
      },
      "apm": {
        "count": 1,
        "enabled": true,
        "metricbeatUsed": false
      }
    }
  ]
}

We are also tracking page views and setup mode clicks, which are available under stack_stats.kibana.plugins.ui_metric.stack_monitoring.

cc @alexfrancoeur

function PageLoadingTracking({ pageViewTitle }) {
const path = pageViewTitle.toLowerCase().replace(/-/g, '').replace(/\s+/g, '_');
console.log({ pageViewTitle, path });
useTrackPageview({ app: 'stack_monitoring', path });
Copy link
Member

@jasonrhodes jasonrhodes Sep 15, 2020

Choose a reason for hiding this comment

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

Can these page titles include dynamic names? You may not want to track every single unique page title/path a user visits, but rather just a subset of normalized ones without dynamic/variable segments.

I also recommend throwing in a 2nd track pageview but with a delay: 15000 on the call, which shows how many clusters stayed on the page some "significant amount of time" and will allow your page views to be compared to other observability ones which are currently all doing that. (We can eventually normalize that so it happens with one call across the board consistently, but for now we are keeping it all very manual.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jasonrhodes Great idea. I was wondering why that was there for the examples I went through.

In terms of dynamic data, this page titles will not contain that. I went through all the unique instance/node pages and ensured the tracking name just said something like kibana_instance. With that said, we still have the beats/apm pages in legacy formats, which I hope to resolve in #76946 before updating here

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
monitoring 1.2MB -4.4KB 1.2MB

page load bundle size

id value diff baseline
monitoring 303.1KB +518.0B 302.6KB

distributable file count

id value diff baseline
default 45852 +6 45846

Saved Objects .kibana field count

id value diff baseline
monitoring-telemetry 2 +2 -

History

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

@chrisronline chrisronline self-assigned this Sep 23, 2020
@chrisronline chrisronline added release_note:skip Skip the PR/issue when compiling release notes review Team:Monitoring Stack Monitoring team v7.10.0 v8.0.0 labels Sep 23, 2020
@chrisronline chrisronline marked this pull request as ready for review September 23, 2020 19:40
@chrisronline chrisronline requested a review from a team as a code owner September 23, 2020 19:40
@chrisronline chrisronline requested a review from a team September 23, 2020 19:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/stack-monitoring (Team:Monitoring)

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Telemetry changes LGTM!

I'm so excited about this new collector! Thank you @chrisronline.

@mindbat Mind the schema changes in x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json

@afharo
Copy link
Member

afharo commented Sep 24, 2020

@chrisronline FYI: we are one approval left to merge this improvement in the schema to be more explicit about the arrays: #78141

If it gets merged before this PR, you might need to update the schema. Otherwise, I will update mine 🙂

Copy link
Contributor

@igoristic igoristic left a comment

Choose a reason for hiding this comment

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

@chrisronline Great job! Everything looks good 👍

I noticed that we're doing fetchLicenseType for every "monitored" cluster, but what about the license of the cluster that's doing the "monitoring"? By using something like plugins.licensing, since it might not be set to monitoring itself in a remote environment

Probably a different metric/feature, but I thought it would be interesting to see which license type is on the monitoring cluster itself

@chrisronline
Copy link
Contributor Author

@igoristic That's a good point actually. We are only reporting data for the monitored clusters, which may or may not include the monitoring cluster itself. I think we can address that in a follow up if necessary. cc @ravikesarwani

@chrisronline chrisronline merged commit a88c272 into elastic:master Sep 25, 2020
chrisronline added a commit that referenced this pull request Sep 25, 2020
* First stab at some internal telemetry

* Add missing files

* mbCount telemetry

* Include more data

* Remove unused field

* This file isn't used

* Mock in tests

* Add schema

* Store schema

* Use sample cluster instead

* Fix telemetry schema

* Fix type issues

* Updates

* Fix schema and tests

* Add tests

* Add tests

* Go back to using an array

* Fix schema

* Add page view data

* Remove debug

* Handle loading scenario here

* Add delay tracking too

* Add clicks for setup mode

* Add clicks for setup mode

* Fix beats/apm page views

* Fix typings
# Conflicts:
#	x-pack/plugins/monitoring/common/constants.ts
@chrisronline
Copy link
Contributor Author

Backport:

7.x: ee7f104

@chrisronline chrisronline deleted the monitoring/telemetry branch September 25, 2020 16:23
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 28, 2020
* master: (226 commits)
  [Enterprise Search] Added Logic for the Credentials View (elastic#77626)
  [CSM] Js errors (elastic#77919)
  Add the @kbn/apm-config-loader package (elastic#77855)
  [Security Solution] Refactor useSelector (elastic#75297)
  Implement tagcloud renderer (elastic#77910)
  [APM] Alerting: Add global option to create all alert types (elastic#78151)
  [Ingest pipelines] Upload indexed document to test a pipeline (elastic#77939)
  TypeScript cleanup in visualizations plugin (elastic#78428)
  Lazy load metric & mardown visualizations (elastic#78391)
  [Detections][EQL] EQL rule execution in detection engine (elastic#77419)
  Update tutorial-full-experience.asciidoc (elastic#75836)
  Update tutorial-define-index.asciidoc (elastic#75754)
  Add support for runtime field types to mappings editor. (elastic#77420)
  [Monitoring] Usage collection (elastic#75878)
  [Docs][Actions] Add docs for Jira and IBM Resilient (elastic#78316)
  [Security Solution][Resolver] Update @timestamp formatting (elastic#78166)
  [Security Solution] Fix app layout (elastic#76668)
  [Security Solution][Resolver] 2 new functions to DAL (elastic#78477)
  Adds new elasticsearch client to telemetry plugin (elastic#78046)
  skip flaky suite (elastic#78512) (elastic#78511) (elastic#78510) (elastic#78509) (elastic#78508) (elastic#78507) (elastic#78506) (elastic#78505) (elastic#78504) (elastic#78503) (elastic#78502) (elastic#78501) (elastic#78500)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes review Team:Monitoring Stack Monitoring team v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants