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

[Maps] Track geo_shape agg usage #71759

Merged
merged 12 commits into from
Jul 15, 2020

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Jul 14, 2020

Closes #69527

Tracks geo_shape aggregation usage as total number of layers that use geo_shape agg per cluster. (it can be used just as a boolean (0 = no gold+ use, >= 0 is gold+ use).

This also makes some TS-typing explicit in the telemetry-code.

@thomasneirynck thomasneirynck added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.9.0 labels Jul 14, 2020
@thomasneirynck thomasneirynck requested a review from a team as a code owner July 14, 2020 20:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@thomasneirynck thomasneirynck added chore release_note:skip Skip the PR/issue when compiling release notes WIP Work in progress labels Jul 14, 2020
@thomasneirynck thomasneirynck removed the WIP Work in progress label Jul 14, 2020
@thomasneirynck thomasneirynck requested review from nreese and kindsun July 14, 2020 23:24
function isGeoShapeAggLayer(indexPatterns: IIndexPattern[], layer: LayerDescriptor): boolean {
if (layer.sourceDescriptor === null) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably good to return early if no geoField here instead of on lines 119-121. You could revise this to:

const sourceDescriptor: SourceDescriptor = layer.sourceDescriptor;
if (!sourceDescriptor || !sourceDescriptor.geoField) {
    return false;
}

Copy link
Contributor Author

@thomasneirynck thomasneirynck Jul 15, 2020

Choose a reason for hiding this comment

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

I'd prefer to avoid it, since we then lose typing-clarity and end up duck typing (which now we have TS there is no reason to. The TS-typecheck will fail with this pattern too). geoField is very specific to ES-sources, and that type-check appears higher-up.

@thomasneirynck thomasneirynck requested review from nreese and kindsun July 15, 2020 17:57
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

miscellaneous assets size

id value diff baseline
upgradeAssistant 22.6KB +12.0B 22.6KB

History

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

@thomasneirynck thomasneirynck merged commit 8a21d11 into elastic:master Jul 15, 2020
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jul 15, 2020
Tracks how many users are using geo_shape aggs.
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jul 15, 2020
Tracks how many users are using geo_shape aggs.
thomasneirynck added a commit that referenced this pull request Jul 15, 2020
Tracks how many layers are using geo_shape aggs.
thomasneirynck added a commit that referenced this pull request Jul 16, 2020
Tracks how many users are using geo_shape aggs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.9.0 v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] Collect telemetry of 7.9 features
5 participants