-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[APM] Use apmEventClient for querying APM event indices #73449
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
Conversation
We don't need a dynamic index pattern for parsing the filters from the query bar. Additionally, instead of fetching uiIndices in `getParamsForSearchRequest`, we can use `indices` that we already fetched in `setupRequest`.
…kibana into remove-dynamic-index-pattern
Instead of using a combination of index + terms filters on processor.event, add a top-level setting that allows you to define a type, which can be a processor event type, agent configuration or custom link. This allows us to more easily compose queries.
…na into optimize-traces-overview
|
Pinging @elastic/apm-ui (Team:apm) |
|
@elasticmachine merge upstream |
smith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice cleanup. I think this will help a lot.
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export enum PROJECTION { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why anything at all in our whole codebase needs to be ALL_CAPS. I prefer the formatting of the ProcessorEvent enum. Just my opinion and I don't care enough to ever block merging of anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, changed.
| sourcemap = 'sourcemap', | ||
| } | ||
|
|
||
| export type UIProcessorEvent = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put a JSDoc comment on here explaining what this means and what it's used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| }); | ||
|
|
||
| it('if index is not an APM index, it should not add `observer.version_major` filter', async () => { | ||
| it('should not add `observer.version_major` filter if `includeLegacyData=true`', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would read better as describe('when includeLegacyData=true', () => { it('does not add an observer.version_major filter', () => ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, restructured the tests.
| ], | ||
| apm: { | ||
| events: [ | ||
| ProcessorEvent.transaction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this array in a few places. Maybe there's a good place to export a uiProcessorEvents that we can reuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIProcessorEvent is specifically meant for public (the query bar). I don't think it belongs in server code.
💚 Build SucceededBuild metricsasync chunks size
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
💚 Backport successfulThe PR was backported to the following branches:
|
(See dgieselaar#3 for other feedback).
In preparation for a metrics-powered UI, we are creating two clients with distinct purposes, one for querying APM events, and an internal client for talking to the APM system indices (
.apm-agent-configurationand.apm-custom-links.The purpose of this PR is to:
The changes being made are:
serverclientinsetupRequestwill be renamed toapmEventClientindex: stringproperty with aapm.events: ProcessorEventproperty. This is type-checked via theAPMEventESSearchRequesttype._sourceare inferred based onapm.events.indexand atermsquery will also be set based onapm.events.internalClientno longer cares about legacy data.getIndicesPrivileges, Elasticsearch is called directly (via the legacy client) with acallClientWithDebughelper.