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

Core usage data #79101

Merged
merged 21 commits into from
Oct 5, 2020
Merged

Core usage data #79101

merged 21 commits into from
Oct 5, 2020

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Oct 1, 2020

Summary

Core Telemetry Service for supplying core metrics to a usage collector (usage collector not implemented yet). I aimed to collect the easy metrics to get this in before FF, but this doesn't collect all the metrics we identified in #56762

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0 labels Oct 1, 2020
@rudolf rudolf added the release_note:skip Skip the PR/issue when compiling release notes label Oct 1, 2020
@TinaHeiligers
Copy link
Contributor

TinaHeiligers commented Oct 1, 2020

@rudolf If it's not too late, can we please rename from "telemetry" to "usage data"? We're trying really hard to reserve using "Telemetry" for only sending the data to the service. We already have a telemetry plugin that it responsible for sending the data and don't want to get the terminology mixed up. It makes it really difficult to debug SDH issues. 🙏

@rudolf rudolf changed the title Core telemetry Core usage data Oct 1, 2020
@rudolf rudolf marked this pull request as ready for review October 2, 2020 05:56
@rudolf rudolf requested review from a team as code owners October 2, 2020 05:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@rudolf
Copy link
Contributor Author

rudolf commented Oct 2, 2020

Still blocked on worked around the issue

node scripts/telemetry_check.js --fix
 ✔ Checking .telemetryrc.json files
 ❯ Extracting Collectors
   ✖ Extracting collectors in /Users/rudolf/dev/kibana/src/plugins/
     → TypeError: Cannot read property 'resolvedFileName' of undefined
     Extracting collectors in /Users/rudolf/dev/kibana/x-pack/plugins/
   Checking Compatible collector.schema with collector.fetch type
   Generating new telemetry mappings
   Updating telemetry mapping files
ERROR Unhandled exception!
ERROR Error: Error extracting collector in src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts
      TypeError: Cannot read property 'resolvedFileName' of undefined
          at createFailError (/Users/rudolf/dev/kibana/packages/kbn-dev-utils/target/run/fail.js:26:26)
          at parseUsageCollection (/Users/rudolf/dev/kibana/packages/kbn-telemetry-tools/src/tools/ts_parser.ts:205:17)
          at parseUsageCollection.next (<anonymous>)
          at extractCollectors (/Users/rudolf/dev/kibana/packages/kbn-telemetry-tools/src/tools/extract_collectors.ts:73:12)
          at extractCollectors.next (<anonymous>)
          at Task.task (/Users/rudolf/dev/kibana/packages/kbn-telemetry-tools/src/tools/tasks/extract_collectors_task.ts:54:36)


export interface CoreUsageData {
config: CoreConfigUsageData;
// services: CoreServicesUsageData;
Copy link
Contributor Author

@rudolf rudolf Oct 2, 2020

Choose a reason for hiding this comment

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

Because the telemetry team asked us not to use ...Telemetry I've switched to ...UsageData but CoreUsageData['usageData'] is a bit awkward, so I deviated from the "spec" in the original issue by using the key "services" with the idea that we would group usage data under the respective Core services they originate from e.g. savedObjects / plugins.

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.

It looks great! Just added a couple of NITs.

Reading through your PR, I acknowledge we (the telemetry team) need to work on our documentation 😅

Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

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

LGTM. Tested with localhost:5601/api/stats?extended and it seemed to work correctly 😄. A couple small nits is all.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

distributable file count

id before after diff
default 44119 44125 +6
oss 28595 28601 +6

History

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

@rudolf rudolf merged commit cd38380 into elastic:master Oct 5, 2020
rudolf added a commit that referenced this pull request Oct 6, 2020
* Core usage data (#79101)

* Core Telemetry service

* CoreTelemetryService mock

* Add missing config values back, cleanup

* Core usage collector

* HttpConfig path is 'server'

* Fix tests

* CoreTelemetry -> CoreUsageData

* Improve tests / docs

* Fix telemetry_check

* Don't catch fetch function exceptions, let usage collector handle it

* Code review

* Collect saved object index usage data

* Fix tests and telemetry_check

* explicitly import/export usage data types for telemetry_check

* Remove OS data for now, test for SO usage data

* Fix tests

* Polish core docs

* This shouldn't be here

* Fix test
@rudolf rudolf deleted the core-telemetry branch October 7, 2020 09:52
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 Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants