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

[APM] Added required fields to infra metrics client #142569

Merged

Conversation

MiriamAparicio
Copy link
Contributor

Little improvement in the infra metrics client, added size and track_total_hits as required fields.

@MiriamAparicio MiriamAparicio added Team:APM - DEPRECATED Use Team:obs-ux-infra_services. release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.6.0 labels Oct 4, 2022
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner October 4, 2022 10:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@@ -9,7 +9,12 @@ import { ESSearchRequest, InferSearchResponseOf } from '@kbn/es-types';
import { APMRouteHandlerResources } from '../../../../routes/typings';
import { getInfraMetricIndices } from '../../get_infra_metric_indices';

type InfraMetricsSearchParams = Omit<ESSearchRequest, 'index'>;
type InfraMetricsSearchParams = Omit<ESSearchRequest, 'index'> & {
body: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you really need the body here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following @sqren suggestion here: #141735 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

No we don't, my bad! I suggested it based on what we have for the apmEventClient:

const response = await apmEventClient.search('get_connection_stats', {
apm: {
events: [ProcessorEvent.metric],
},
body: {

But the infraMetricsClient doesn't have a body params so we can omit that.

@kpatticha
Copy link
Contributor

Thanks for adding the required fields. 💯
You'll also need to pass the fields as params wherever we use infraMetricsClient

Comment on lines 13 to 16
body: {
size: number;
track_total_hits: boolean | number;
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
body: {
size: number;
track_total_hits: boolean | number;
};
size: number;
track_total_hits: boolean | number;

@MiriamAparicio MiriamAparicio force-pushed the improvements-infra-client branch from cebf5e6 to 9eddf10 Compare October 5, 2022 08:30
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@MiriamAparicio
Copy link
Contributor Author

@sqren can you take a look at track_total_hits, I'm not sure about the value in each case, thanks

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

Looks great. We don't use hits.total.value in any of these queries so track_total_hits can safely be disabled (false) as you did.

@MiriamAparicio MiriamAparicio merged commit d3370cf into elastic:main Oct 5, 2022
@MiriamAparicio MiriamAparicio deleted the improvements-infra-client branch October 5, 2022 14:07
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
* Added required fields to infra metrics client

* add fields to the requests

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

Co-authored-by: kibanamachine <[email protected]>
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
* Added required fields to infra metrics client

* add fields to the requests

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants