Skip to content

Move runtime fields stats to server #69487

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

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Feb 23, 2021

Runtime fields usage is currently reported as part of the xpack feature usage API. Now that runtime fields are part of server, their corresponding stats can be moved to be part of the ordinary mapping stats exposed by the cluster stats API.

This is the last bit of functionality left in the xpack runtime-fields plugin, hence we can remove the plugin as part of this change too.

This PR removes the runtime-fields feature from the xpack/usage and xpack/info output, in favour of reporting runtime_field_types stats as part of the output of the cluster stats API together with the existing field types stats.

Runtime fields usage is currently reported as part of the xpack feature usage API. Now that runtime fields are part of server, their corresponding stats can be moved to be part of the ordinary mapping stats exposed by the cluster stats API.
@javanna javanna added :Search Foundations/Mapping Index mappings, including merging and defining field types >refactoring v8.0.0 v7.13.0 labels Feb 23, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Feb 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

javanna added a commit to javanna/elasticsearch that referenced this pull request Feb 24, 2021
 Runtime fields usage is currently reported as part of the xpack feature usage API. Now that runtime fields are part of server, their corresponding stats can be moved to be part of the ordinary mapping stats exposed by the cluster stats API.
Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

I took a look at the approach, and the approach to BWC makes sense to me. Two high-level comments:

  • This is technically a breaking API change, so I wonder if we should only make it only master. Or do our telemetry APIs have special status, and we're more lenient with breaks?
  • It'd be great to maintain some YML tests that exercise the xpack usage API in mixed-cluster scenarios. This would give us extra confidence that the xpack usage API behaves as expected when runtime fields are enabled in a mixed 7.12 and 7.13 scenario.

@javanna
Copy link
Member Author

javanna commented Mar 4, 2021

This is technically a breaking API change, so I wonder if we should only make it only master. Or do our telemetry APIs have special status, and we're more lenient with breaks?

Agreed, I worked under the assumption that xpack/usage is an internal API and that moving the telemetry stats to the right place as soon as possible is ideal given that telemetry is the only thing left on the xpack runtime fields plugin. These fields are not even mapped on the telemetry cluster so we should be safe here. I could leave the runtime fields feature in the response output in 7.x, but with the empty runtime_field_types array: that would avoid breaking the response format, but I am not sure it would bring any value.

It'd be great to maintain some YML tests that exercise the xpack usage API in mixed-cluster scenarios. This would give us extra confidence that the xpack usage API behaves as expected when runtime fields are enabled in a mixed 7.12 and 7.13 scenario.

We do have some which indeed failed and led me to keeping the named writeable around in 7.x. As for the expected behaviour in a mixed cluster: I think that we should ensure things don't break, but there is no guarantee that runtime fields stats will be accurate. Mixed clusters are a temporary scenario in which runtime field stats will be inaccurate depending on which node is hit with the request, until the cluster is all upgraded to 7.13+ nodes.

I was chatting to @rjernst about this the other day and I would be keen to have his opinion too.

I am thinking that getting in the 7.x first (#69542), and then this one should make sure that there are no problems with bwc tests.

@jtibshirani
Copy link
Contributor

We do have some which indeed failed and led me to keeping the named writeable around in 7.x

I was thinking of a test where runtime fields were actually present in the mapping, which I don't think we test anymore? This is just a small suggestion though.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

@rjernst
Copy link
Member

rjernst commented Mar 5, 2021

This is technically a breaking API change

I don't see it as breaking, since the xpack API this was a part of was not meant for external consumption. It's entire purpose is telemetry, and we don't document the API.

@javanna javanna merged commit ffe61fb into elastic:master Mar 8, 2021
javanna added a commit that referenced this pull request Mar 8, 2021
 Runtime fields usage is currently reported as part of the xpack feature usage API. Now that runtime fields are part of server, their corresponding stats can be moved to be part of the ordinary mapping stats exposed by the cluster stats API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants