-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] Track geo_shape agg usage #71759
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
function isGeoShapeAggLayer(indexPatterns: IIndexPattern[], layer: LayerDescriptor): boolean { | ||
if (layer.sourceDescriptor === null) { | ||
return false; | ||
} |
There was a problem hiding this comment.
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;
}
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
code review
💚 Build SucceededBuild metricsmiscellaneous assets size
History
To update your PR or re-run it, just comment with: |
Tracks how many users are using geo_shape aggs.
Tracks how many users are using geo_shape aggs.
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.