-
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] Service maps anomaly detection integration by environment #70932
[APM] Service maps anomaly detection integration by environment #70932
Conversation
- Adds anomaly detection integration to service maps backed by apm ML jobs per environment - Loads transaction stats and anomalies for each transaction types - Renders a selector in the popop to choose a transaction type to view stats
…e maps popover - only aggregates transaction KPIs and anomaly scores for transaction.type = "request" or "page-load" - supports environment filter 'All' option to display data from all APM anomaly detection jobs - handle case where popover metrics don't exist for services outside the current environment filter
c383cb4
to
13a95fd
Compare
Pinging @elastic/apm-ui (Team:apm) |
if (!matchingMLJob) { | ||
throw new Error(`ML job Not Found for environment "${environment}".`); | ||
} |
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.
When would this happen? And how is this error handled?
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 happen if the user selects an environment in the filter which doesn't have an ml job. We handle it by logging the error then returning an empty set of service anomalies. This surfaces to the user as having no anomaly data for the selected service. Then they can update their filters to see anomalies in the map.
x-pack/plugins/apm/public/components/app/ServiceMap/Popover/AnomalyDetection.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/service_map/transform_service_map_responses.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricList.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLJobLink.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.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.
Two small text recommendations from me.
x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricFetcher.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricFetcher.tsx
Outdated
Show resolved
Hide resolved
then filters for it when returing valid APM ML jobs
x-pack/plugins/apm/server/lib/service_map/transform_service_map_responses.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
- renders the "no data" message as plain text instead of in a callout - hides the 'Anomaly detection' section if there is not anomaly data.
filters properly by filtering for docs where service.environment does not exist
…_tags.apm_ml_version`
…-maps-anomaly-detection
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/lens/smokescreen·ts.lens app lens smokescreen tests should allow creation of lens visualizationsStandard Out
Stack Trace
Build metrics
History
To update your PR or re-run it, just comment with: |
…tic#70932) * Closes elastic#69480 & elastic#70419. - Adds anomaly detection integration to service maps backed by apm ML jobs per environment - Loads transaction stats and anomalies for each transaction types - Renders a selector in the popop to choose a transaction type to view stats * - implements original anomaly detection integration design for service maps popover - only aggregates transaction KPIs and anomaly scores for transaction.type = "request" or "page-load" - supports environment filter 'All' option to display data from all APM anomaly detection jobs - handle case where popover metrics don't exist for services outside the current environment filter * fixes some CI errors * Simplified messaging for service popop with not data in the current environment * PR feedback, renamed max anomalies -> service anomalies including the file name * - defines custom_settings.job_tags.apm_ml_version in ML job creation, then filters for it when returing valid APM ML jobs * changes shape of of service anomalies from an array to a object keyed by serviceName * removes the url encoding from ML job link href to how it was previously. * PR feedback * Popover no data state simplified: - renders the "no data" message as plain text instead of in a callout - hides the 'Anomaly detection' section if there is not anomaly data. * Fixes filtering bug when user selects 'Environment: Not defined'. Now filters properly by filtering for docs where service.environment does not exist * filters jobs fetched in the settings page by `job.custom_settings.job_tags.apm_ml_version` * Fixed bad import from last upstream merge Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
…) (#71391) * Closes #69480 & #70419. - Adds anomaly detection integration to service maps backed by apm ML jobs per environment - Loads transaction stats and anomalies for each transaction types - Renders a selector in the popop to choose a transaction type to view stats * - implements original anomaly detection integration design for service maps popover - only aggregates transaction KPIs and anomaly scores for transaction.type = "request" or "page-load" - supports environment filter 'All' option to display data from all APM anomaly detection jobs - handle case where popover metrics don't exist for services outside the current environment filter * fixes some CI errors * Simplified messaging for service popop with not data in the current environment * PR feedback, renamed max anomalies -> service anomalies including the file name * - defines custom_settings.job_tags.apm_ml_version in ML job creation, then filters for it when returing valid APM ML jobs * changes shape of of service anomalies from an array to a object keyed by serviceName * removes the url encoding from ML job link href to how it was previously. * PR feedback * Popover no data state simplified: - renders the "no data" message as plain text instead of in a callout - hides the 'Anomaly detection' section if there is not anomaly data. * Fixes filtering bug when user selects 'Environment: Not defined'. Now filters properly by filtering for docs where service.environment does not exist * filters jobs fetched in the settings page by `job.custom_settings.job_tags.apm_ml_version` * Fixed bad import from last upstream merge Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes #69480
page-load
for RUM services andrequest
for everything else