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] Use force_synthetic_source in API tests #144300

Merged
merged 3 commits into from
Nov 1, 2022

Conversation

dgieselaar
Copy link
Member

Closes #140255.

Adds a setting that, when true, tacks on force_synthetic_source for all requests that involve metric indices. This should help us prepare for synthetic source. The setting should only be used in API tests.

@dgieselaar dgieselaar added Team:APM All issues that need APM UI Team support release_note:skip Skip the PR/issue when compiling release notes v8.6.0 labels Nov 1, 2022
@dgieselaar dgieselaar requested a review from a team as a code owner November 1, 2022 08:48
@elasticmachine
Copy link
Contributor

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

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 57 63 +6
osquery 103 108 +5
securitySolution 439 443 +4
total +17

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 65 71 +6
osquery 104 110 +6
securitySolution 516 520 +4
total +18

History

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

Copy link
Contributor

@gbamparop gbamparop left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -54,6 +54,7 @@ const configSchema = schema.object({
sourcemap: schema.string({ defaultValue: 'apm-*' }),
onboarding: schema.string({ defaultValue: 'apm-*' }),
}),
forceSyntheticSource: schema.boolean({ defaultValue: false }),
Copy link
Contributor

Choose a reason for hiding this comment

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

If this needs to be a config maybe it's good to add it to the docs as well

Copy link
Member Author

Choose a reason for hiding this comment

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

What docs? It's really only intended for us.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I think it's OK to leave it out for now, it's developer only and I'm assuming we can get rid of it soon.

@@ -149,11 +152,18 @@ export class APMEventClient {
this.indices
);

const forceSyntheticSourceForThisRequest =
this.forceSyntheticSource &&
params.apm.events.includes(ProcessorEvent.metric);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens to other non-metric events when this is enabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

If an index is not synthetic source-compatible, I assume it results in a shard failure, but only when actually fetching the documents. E.g., if size is 0 or the top scoring documents are retrieved from compatible indices, it still works. I prefer this approach over only using force_synthetic_source when only the metrics data stream is being queried, because this currently works, and I'd like to eliminate false positives over preventing false negatives. At least we get notified of the latter.

@dgieselaar dgieselaar merged commit 1acc9a4 into elastic:main Nov 1, 2022
@dgieselaar dgieselaar deleted the force-synthetic-source branch November 1, 2022 13:36
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 1, 2022
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 All issues that need APM UI Team support v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Use _force_synthetic_source instead of fakeSyntheticSource
6 participants