-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Split dependencies API adding a new API to return comparison statistics #95407
[APM] Split dependencies API adding a new API to return comparison statistics #95407
Conversation
d29b7c1
to
f22c24d
Compare
x-pack/plugins/apm/server/lib/services/get_service_dependencies/get_metrics.ts
Outdated
Show resolved
Hide resolved
Pinging @elastic/apm-ui (Team:apm) |
x-pack/plugins/apm/server/lib/services/get_service_dependencies/index.ts
Outdated
Show resolved
Hide resolved
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.
Few code style nits, but everything looks good and works locally for me!
@cauemarcondes can you verify:
|
/oblt-deploy |
1 similar comment
/oblt-deploy |
sorry for the noise I was testing the build with comments |
@dgieselaar Even though a single query that fetches both periods is a few ms slower, in the end, the result is a bit faster than having two queries. But the difference isn't that much, so I'd rather keeping with what I've done on this PR if it's okay for you. |
@cauemarcondes can you put some numbers to that and elaborate on the two things that you compared? |
@dgieselaar I'm comparing the response time, for the last 15 minutes.
Most of the time the Do you want me to run any specific test? |
@cauemarcondes you need to call ES directly, on a longer time range. There are many other things happening in a request that will influence the result. If you open a trace from an instrumented Kibana instance you can see that there are other ES calls that happen before that. Edit: also, are the two queries in parallel, or one after the other? Also can you post the full ES search requests for both strategies? |
They are running in parallel with Promise.all. In these two files, there are all queries made for both strategies. |
@cauemarcondes I would also recommend to run them through the profiler to see what the differences are. |
just did it: Fetching current and comparison periods in a single query: By comparing the two images, it clear that the single query strategy is worse than the two queries. Especially because the two queries will run in parallel. Based on that I'd say going for the two queries strategy would be the best solution, WDYT @dgieselaar ? |
@dgieselaar the dependency will be shown in the table, with the comparison sparkline but without the value beside it. I think if we show the value as well the user might be confused and think that the value shown is from the current period. Alternatively, we could show it in a different color. @formgeist |
...ins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/services/get_service_dependencies/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/services/get_service_dependencies/index.ts
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/services/get_service_dependencies/index.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
x-pack/plugins/apm/server/lib/services/get_service_dependencies/find_common_connections.test.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
x-pack/plugins/apm/server/lib/services/get_service_dependencies/index.ts
Outdated
Show resolved
Hide resolved
"impact": 1.36961744704522, | ||
"latency": 2568.40816326531, | ||
"currentPeriodImpact": 1.54893576051104, | ||
"name": "elasticsearch", | ||
"throughput": 13.0666666666667, | ||
"previousPeriodImpact": 1.19757368986118, |
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.
Why did impact change from "1.36961744704522" to "1.54893576051104"?
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.
That's because the value 1.36961744704522
was based on the entire 30 minutes of data before adding the comparison range. With the comparison time range filtering the result, it is only 15 minutes for the current period and 15 minutes for the previous period. That's why it changed to 1.54893576051104
and now it also has "previousPeriodImpact": 1.19757368986118,
@@ -441,38 +444,33 @@ export default function ApiTest({ getService }: FtrProviderContext) { | |||
const impactValues = sortBy( | |||
response.body.serviceDependencies.map((item) => ({ | |||
name: item.name, | |||
impact: item.impact, | |||
latency: item.latency.value, |
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.
Was latency not used here?
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.
Then latency values are already being checked in another test
kibana/x-pack/test/apm_api_integration/tests/service_overview/dependencies/index.ts
Line 371 in a1acc7e
it('returns the right latency values', () => { |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
closes #90575
Comparison enabled:
Comparison disabled: