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

[Usage Collection] Supports field descriptions as meta data #92701

Conversation

TinaHeiligers
Copy link
Contributor

@TinaHeiligers TinaHeiligers commented Feb 24, 2021

Resolves #89685

This PR enables support for field-level descriptions to allow developers to document what each field in their collector represents.

The description is support as plain text and makes no assumptions on the length of the string that is provided.

The description is added to an optional new schema field level _meta object that will enable other meta data to be added at a later stage.

Descriptions are added to the localization collector as an initial implementation example.
Before:

schema: {
  locale: { type: 'keyword' },
  integrities: { DYNAMIC_KEY: { type: 'text' } },
  labelsCount: { type: 'long' },
},

After:

schema: {
  locale: {
    type: 'keyword',
    _meta: {
      description: 'The default locale set on the Kibana system',
    },
  },
  integrities: {
    DYNAMIC_KEY: {
      type: 'text',
      _meta: {
        description:
          'Translation file hash. If the hash is different it indicates that a custom translation file is used',
      },
    },
  },
  labelsCount: {
    type: 'long',
    _meta: {
      description: 'The number of translated labels',
    },
  },
},

Adds descriptions to usage collectors in kibana_usage_collection:

  • application Usage
  • core
  • csp
  • kibana
  • localization
  • management
  • ops stats
  • ui counters
  • ui metric

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@TinaHeiligers TinaHeiligers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc enhancement New value added to drive a business result Feature:Telemetry v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.13.0 labels Feb 24, 2021
@TinaHeiligers TinaHeiligers requested review from afharo and Bamieh and removed request for afharo and Bamieh February 24, 2021 19:22
@elastic elastic deleted a comment from kibanamachine Feb 24, 2021
@TinaHeiligers TinaHeiligers enabled auto-merge (squash) March 1, 2021 21:43
@TinaHeiligers TinaHeiligers added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 1, 2021
@TinaHeiligers TinaHeiligers requested a review from afharo March 1, 2021 21:43
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.

I noticed 2 gotchas (probably IDE related). Once those are fixed, it LGTM.

TinaHeiligers and others added 3 commits March 2, 2021 07:56
…nt/schema.ts

Co-authored-by: Alejandro Fernández Haro <[email protected]>
…nt/schema.ts

Co-authored-by: Alejandro Fernández Haro <[email protected]>
Add trailing whitespace back.
@TinaHeiligers TinaHeiligers disabled auto-merge March 2, 2021 15:28
@TinaHeiligers TinaHeiligers changed the title [Usage Collection] Supports field descriptions as meta data [Usage Collection] Supports field descriptions as meta data Mar 2, 2021
@TinaHeiligers TinaHeiligers requested a review from afharo March 2, 2021 15:29
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.

LGTM! Pending on green CI! Thank you for doing this @TinaHeiligers

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) March 2, 2021 16:37
@elastic elastic deleted a comment from kibanamachine Mar 2, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
triggersActionsUi 1.6MB 1.5MB -23.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 104.0KB 104.1KB +82.0B
Unknown metric groups

async chunk count

id before after diff
triggersActionsUi 41 42 +1

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

@TinaHeiligers TinaHeiligers merged commit d230720 into elastic:master Mar 2, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

❌ 7.x: Commit could not be cherrypicked due to conflicts

To backport manually, check out the target branch and run:
node scripts/backport --pr 92701

TinaHeiligers added a commit to TinaHeiligers/kibana that referenced this pull request Mar 2, 2021
…92701)

Co-authored-by: Alejandro Fernández Haro <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	src/plugins/kibana_usage_collection/server/collectors/management/schema.ts
TinaHeiligers added a commit that referenced this pull request Mar 2, 2021
…2701) (#93295)

* [Usage Collection] Supports field descriptions as meta data (#92701)

Co-authored-by: Alejandro Fernández Haro <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	src/plugins/kibana_usage_collection/server/collectors/management/schema.ts

* Updates schema
@TinaHeiligers TinaHeiligers deleted the usage-collection/supports-descriptions branch March 23, 2021 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed enhancement New value added to drive a business result Feature:Telemetry 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.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Usage Collection] Add description field to schema
4 participants