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] [schema] lens #77929

Merged
merged 5 commits into from
Sep 24, 2020

Conversation

afharo
Copy link
Member

@afharo afharo commented Sep 18, 2020

Summary

  • Add schema definition to the collector lens.
  • Add support for type aliases, & unions and Record<string, SOMETHING> in the @kbn/telemetry-tools
  • Fixed additional nesting in IndexSignature definitions in @kbn/telemetry-tools

Related to #70180.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry)

@afharo afharo added the release_note:skip Skip the PR/issue when compiling release notes label Sep 18, 2020
indexpattern_dimension_operation_max: { type: 'long' },
indexpattern_dimension_operation_sum: { type: 'long' },
indexpattern_dimension_operation_count: { type: 'long' },
indexpattern_dimension_operation_cardinality: { type: 'long' },
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you are missing one of the newly added functions, indexpattern_dimension_operation_filters

Copy link
Contributor

Choose a reason for hiding this comment

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

added here

const suggestionEventsSchema: MakeSchemaFrom<LensUsage['suggestion_events_30_days']> = {
back_to_current: { type: 'long' },
reload: { type: 'long' },
position_0_of_5: { type: 'long' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Just removed this one

Suggested change
position_0_of_5: { type: 'long' },


const savedSchema: MakeSchemaFrom<LensUsage['saved_overall']> = {
bar_stacked: { type: 'long' },
// TODO: Extend this list as we know more visualizationTypes
Copy link
Contributor

Choose a reason for hiding this comment

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

},
"indexpattern_dimension_operation_cardinality": {
"type": "long"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about the filters operation

Copy link
Contributor

Choose a reason for hiding this comment

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

"type": "long"
},
"position_0_of_5": {
"type": "long"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not valid any more

@afharo
Copy link
Member Author

afharo commented Sep 18, 2020

Thank you @wylieconlon! I've amended the schema. Do you mind taking a second look?

@afharo afharo requested a review from wylieconlon September 18, 2020 17:07
Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Approving the Lens-related parts, can't comment on the more general changes

@afharo
Copy link
Member Author

afharo commented Sep 21, 2020

@elasticmachine merge upstream

@afharo
Copy link
Member Author

afharo commented Sep 23, 2020

@elasticmachine merge upstream

@afharo
Copy link
Member Author

afharo commented Sep 23, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

distributable file count

id value diff baseline
default 45868 +1 45867

History

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

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

I'm not sure if we missed position_0_of_5 in the schema or if it's added in the indexing layer.
Otherwise. LGTM


const suggestionEventsSchema: MakeSchemaFrom<LensUsage['suggestion_events_30_days']> = {
back_to_current: { type: 'long' },
reload: { type: 'long' },
Copy link
Contributor

Choose a reason for hiding this comment

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

xpack-phone-home also has a position_0_of_5 field (type: long) in the suggestion_events_30_days field.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wylie asked to remove it because they are not sending it anymore 🙂

@@ -157,6 +165,19 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor |
return uniqueKinds[0];
}

// Support `type MyUsageType = SomethingElse`
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I'm not a fan of type aliases but see them often enough to warrant adding support here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. The underlying reason to support it is type MyType = Something & SomethingElse, which definitely has a point 🙂

@afharo afharo merged commit 4d08763 into elastic:master Sep 24, 2020
@afharo afharo deleted the usage_collection/schema/lens branch September 24, 2020 10:41
afharo added a commit to afharo/kibana that referenced this pull request Sep 24, 2020
afharo added a commit that referenced this pull request Sep 24, 2020
Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
@lukeelmers lukeelmers added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Oct 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens 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.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants