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

[ES|QL] don't suggest snapshot-only functions #192712

Closed
drewdaemon opened this issue Sep 12, 2024 · 12 comments · Fixed by #195691
Closed

[ES|QL] don't suggest snapshot-only functions #192712

drewdaemon opened this issue Sep 12, 2024 · 12 comments · Fixed by #195691
Assignees
Labels
Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana

Comments

@drewdaemon
Copy link
Contributor

drewdaemon commented Sep 12, 2024

We should not suggest functions that are only available on Elasticsearch snapshots. However, we should accept them if the user types them (not throw validation errors).

We should also exclude snapshot-only functions from the inline docs

Technical plan

With elastic/elasticsearch#113544, Elasticsearch will be adding the snapshot_only property to function definitions. When generating function definitions on our side, snapshot_only should be interpreted as our ignoreAsSuggestion function definition property (and we have to make that work for all function types because it is currently only in use for operators).

@drewdaemon drewdaemon added Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana labels Sep 12, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@stratoula
Copy link
Contributor

@drewdaemon can we prioritize it for 8.16?

@drewdaemon
Copy link
Contributor Author

@stratoula absolutely. It is one of the next things I will do.

@drewdaemon drewdaemon self-assigned this Sep 13, 2024
@drewdaemon
Copy link
Contributor Author

Or, we could always be smarter about this and use the cluster response to detect whether Kibana is pointed at a snapshot cluster...

{
  "name" : "MacBook-Pro.local",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "SHmCgXLjSWSTx1GqTROykw",
  "version" : {
    "number" : "8.15.0-SNAPSHOT",
    ...
    "build_snapshot" : true,
  },
  "tagline" : "You Know, for Search"
}

That way, we could suggest these functions on snapshots and pretend like they don't exist on non-snapshots. Feels a bit cleaner. WDYT @stratoula

@stratoula
Copy link
Contributor

Interesting idea. How can we get the cluster info?

@drewdaemon
Copy link
Contributor Author

GET <cluster-url>:9200

@drewdaemon
Copy link
Contributor Author

Looks like we already do it for telemetry collection:

https://github.com/elastic/kibana/blob/main/src/plugins/telemetry/server/telemetry_collection/get_cluster_info.ts#L20

But, esClient is only server-side so we'd probably need an ES|QL endpoint

@stratoula
Copy link
Contributor

I was expecting that, I am not sure if it is worth it (I mean to create an endpoint and do an extra call). I think using the ES preview is enough. I don't think we are gaining a lot unless I am missing something.

@drewdaemon
Copy link
Contributor Author

@stratoula makes sense, but I thought we were creating an endpoint anyways, so this could be something to keep in our back pocket. I don't think this will the be the last time the idea of having the editor react to state from the Elasticsearch cluster will come up (e.g. feature flags, version upgrades, custom functions).

@stratoula
Copy link
Contributor

@drewdaemon totally, we are def keeping it as an idea.

@drewdaemon drewdaemon changed the title [ES|QL] automate preview status for functions [ES|QL] automate snapshot-only status for functions Sep 25, 2024
@drewdaemon drewdaemon changed the title [ES|QL] automate snapshot-only status for functions [ES|QL] don't suggest snapshot-only functions Sep 25, 2024
@drewdaemon
Copy link
Contributor Author

Blocked on elastic/elasticsearch#113544

@drewdaemon
Copy link
Contributor Author

Unblocked!

@drewdaemon drewdaemon removed the blocked label Oct 3, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 11, 2024
## Summary

Close elastic#192712

Snapshot-only functions are no longer suggested by the editor, though
they are still validated if typed.

Also, they are excluded from the inline function documentation.

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 65df028)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants