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

nodes().stats() doesn't return node version #707

Closed
mightycoco opened this issue Nov 16, 2023 · 2 comments · Fixed by #824
Closed

nodes().stats() doesn't return node version #707

mightycoco opened this issue Nov 16, 2023 · 2 comments · Fixed by #824
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@mightycoco
Copy link

mightycoco commented Nov 16, 2023

Java API client version

8.10.3

Java version

20.0.2

Elasticsearch Version

8.9.0

Problem description

Using the rest endpoint _nodes/process I was accessing the
node[].name
node[].version
node[].roles
The endpoint nodes().stats().nodes() only returns name and roles but not the node version.

co.elastic.clients.elasticsearch.nodes.Stats resp. co.elastic.clients.elasticsearch.nodes.Stats.Builder used in co.elastic.clients.elasticsearch.nodes.NodesStatsResponse doesn't contain a version field.

Additionally I couldn't find a way to reduce the amount of information to be transferred over the wire. Whilst the rest endpoints _nodes/process returns only basic information + process, _nodes/_all returns everything.

However, the java API doesn't allow to request only the basic information + process but always transfers everything to be deserialized.
Expected in .nodes().stats(s->s.fields("process")) only the process field is being requested and all other fields (except basic information) is null, butt all data is requested and requested and returned.

reducing the responded fields must be done using metrics:

client.nodes().stats(s->s.metric("process"))
@l-trotta l-trotta added the Area: Specification Related to the API spec used to generate client code label Apr 24, 2024
@l-trotta
Copy link
Contributor

Hello, thanks for reporting this! Seems like we're missing some fields in the API specification used to produce the Java code, we'll add them and regenerate the client code to fix this issue.

@l-trotta
Copy link
Contributor

Hey! So in elasticsearch calling _nodes/process just means calling _nodes and then just filtering process out of all the information _nodes returns, so the direct equivalent of doing that in the java client is to call:

client.nodes().info();

and retrieving the desired node info, which will then contain both process and version.
This endpoint was broken because of some mismatching optional type, it will be fixed in the next version. Thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants