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] Anomaly detection setup link with alert if job doesn't exist #71229

Merged
merged 6 commits into from
Jul 13, 2020

Conversation

ogupte
Copy link
Contributor

@ogupte ogupte commented Jul 9, 2020

Closes elastic#70440 by adding a setup link to anomaly detection setting in the home header.

anomaly-detection-setup-link-0

Screen Shot 2020-07-08 at 11 08 22 PM

@ogupte ogupte requested a review from a team as a code owner July 9, 2020 12:32
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Jul 9, 2020
@elasticmachine
Copy link
Contributor

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

@sorenlouv
Copy link
Member

Already added feedback here: ogupte#3

@ogupte
Copy link
Contributor Author

ogupte commented Jul 10, 2020

@elasticmachine merge upstream

environment === ENVIRONMENT_NOT_DEFINED
? ENVIRONMENT_NOT_DEFINED_FILTER
: { term: { [SERVICE_ENVIRONMENT]: environment } },
...[getEnvironmentUiFilterES(environment)],
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing this also 👍

Comment on lines 50 to 53
const environmentFilter = getEnvironmentUiFilterES(environment);
if (environmentFilter) {
filter.push(environmentFilter);
}
Copy link
Member

Choose a reason for hiding this comment

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

Slightly cleaner:

Suggested change
const environmentFilter = getEnvironmentUiFilterES(environment);
if (environmentFilter) {
filter.push(environmentFilter);
}
const filter: ESFilter[] = [
{ range: rangeFilter(start, end) },
{ term: { [SERVICE_NAME]: serviceName } },
...[getEnvironmentUiFilterES(environment)]
];

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 tried this at first, but it fails the type check since getEnvironmentUiFilterES returns ESFilter | undefined. I could change it to return ESFilter[], so we can always safely spread it in (...getEnvironmentUiFilterES(environment)).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 4bf17ee

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.

Just a few small nits. LGTM 👍

@ogupte
Copy link
Contributor Author

ogupte commented Jul 13, 2020

@elasticmachine merge upstream

Comment on lines +31 to +33
...getKueryUiFilterES(uiFilters.kuery),
...getEnvironmentUiFilterES(uiFilters.environment),
].concat(mappedFilters) as ESFilter[];
Copy link
Member

@sorenlouv sorenlouv Jul 13, 2020

Choose a reason for hiding this comment

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

Nice change, thanks! Can we use spread for mappedFilters instead of concat (for consistency)?

Suggested change
...getKueryUiFilterES(uiFilters.kuery),
...getEnvironmentUiFilterES(uiFilters.environment),
].concat(mappedFilters) as ESFilter[];
...getKueryUiFilterES(uiFilters.kuery),
...getEnvironmentUiFilterES(uiFilters.environment),
...mappedFilters
] as ESFilter[];

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@ogupte ogupte merged commit ae231fe into elastic:master Jul 13, 2020
ogupte added a commit to ogupte/kibana that referenced this pull request Jul 13, 2020
…lastic#71229)

* Closes elastic#70440 by adding a setup link to anomaly detection setting in the home header

* PR feedback and type error fix

* Code cleanup and PR feedback

* Modified getEnvironmentUiFilterES return type from `ESFilter | undefined` to `ESFilter[]` for ease of use.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 13, 2020
* master: (28 commits)
  skip flaky suite (elastic#71361)
  [Ingest Manager] Add UI to enroll standalone agent (elastic#71288)
  Node options from cfg file for production (elastic#62468)
  [APM] Improvements to the ML Settings page (elastic#71309)
  add old .chromium to gitignore to prevent it from being accidentally committed
  [Ingest Manager] Simplify add/edit package config (integration) form (elastic#71187)
  Ensure Other bucket works on scripted fields. (elastic#71329)
  [APM] Anomaly detection setup link with alert if job doesn't exist (elastic#71229)
  [APM] Anomaly detection integration with transaction duration chart (elastic#71230)
  inclusive language (elastic#71438)
  [Ingest Manager] During fleet setup create an enrollment for every config (elastic#71308)
  Improvements to our developer guide (elastic#67764)
  [SIEM][Detections] Fixes index patterns order (elastic#71270)
  [Metrics + Logs UI] Add test for logs and metrics telemetry (elastic#70858)
  [Maps] Inclusive language (elastic#71427)
  [Logs UI] Unskip log highlight api integration test (elastic#71058)
  [Security_Solution][Resolver] Style adjustments per UX (elastic#71179)
  [Functional test] Increase the timeout to click new vis function (elastic#71226)
  [Discover] Migrate async import of embeddable factory to actual embeddable (elastic#70920)
  fix overflow (elastic#70723)
  ...
ogupte added a commit that referenced this pull request Jul 13, 2020
…71229) (#71459)

* Closes #70440 by adding a setup link to anomaly detection setting in the home header

* PR feedback and type error fix

* Code cleanup and PR feedback

* Modified getEnvironmentUiFilterES return type from `ESFilter | undefined` to `ESFilter[]` for ease of use.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement Team:APM All issues that need APM UI Team support v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Anomaly detection: Display Anomaly detection option in the APM header
4 participants