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] Integrate Alert Search bar in alert tab #149610

Merged
merged 11 commits into from
Jan 27, 2023

Conversation

kpatticha
Copy link
Contributor

@kpatticha kpatticha commented Jan 26, 2023

Summary

Closes: #146290

  • Integrate Alert search bar
  • Delete alerts status filters as it comes for free with the search bar
  • Respect time range when fetching alert counts on service inventory and service overview page
    • as the search bar now supports time ranges, it's required to display consistent data.

Before

image

After

Screen.Recording.2023-01-26.at.17.37.44.mov

TODO

  • getServiceAlerts query doesn't include environment while the table respects that filter. Check what's the correct way.

@kpatticha kpatticha added enhancement New value added to drive a business result v8.7.0 labels Jan 26, 2023
@kpatticha kpatticha requested a review from a team as a code owner January 26, 2023 16:42
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Jan 26, 2023
@elasticmachine
Copy link
Contributor

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

@kpatticha kpatticha added release_note:enhancement ci:cloud-deploy Create or update a Cloud deployment labels Jan 26, 2023
Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of suggestions.

Comment on lines 78 to 83
push(history, {
query: {
rangeFrom,
},
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will be better to visualize. WDYT?

Suggested change
push(history, {
query: {
rangeFrom,
},
})
}
push(history, { query: { rangeFrom, }, }) }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean "visualize" ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant just to write it in a single line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated here 1e899e0

Comment on lines 84 to 90
onRangeToChange={(rangeTo) =>
push(history, {
query: {
rangeTo,
},
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you do something like that? I haven't tested it and feel free to ignore it 😅

function pushToHistory(value: any) {
    push(history, { query: { [value]: value } });
  }
Suggested change
onRangeToChange={(rangeTo) =>
push(history, {
query: {
rangeTo,
},
})
}
onRangeToChange={pushToHistory}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me try it 😃

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, you'll probably do something like. Maybe not worth it.

function pushToHistory({key:string, value: any}) {
    push(history, { query: { [key]: value } });
  }

@@ -55,6 +55,18 @@ export function getEnvironmentEsField(environment: string) {
return { [SERVICE_ENVIRONMENT]: environment };
}

export function getEnvironmentKuery(environment: string) {
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
Contributor Author

Choose a reason for hiding this comment

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

I could use it like this:

const environmentValue = getEnvironmentEsField(environment)?.[SERVICE_ENVIRONMENT]

let query = `${SERVICE_NAME}:${serviceName}`;

 if (environmentKuery) {
    // HERE I need to use again `SERVICE_ENVIRONMENT`
      query += ` AND ${SERVICE_ENVIRONMENT}: ${environmentValue}`;
 }

so I thought it might be cleaner to have the function getEnvironmentKuery responsible for returning the kuery

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jan 27, 2023

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1368 1367 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.3MB 3.3MB -150.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
apm 32.2KB 32.2KB +49.0B

History

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

@kpatticha kpatticha enabled auto-merge (squash) January 27, 2023 15:37
@kpatticha kpatticha merged commit 5476c93 into elastic:main Jan 27, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jan 27, 2023
@@ -43,18 +44,30 @@ export const ENVIRONMENT_NOT_DEFINED = {
label: getEnvironmentLabel(ENVIRONMENT_NOT_DEFINED_VALUE),
};

export function getEnvironmentEsField(environment: string) {
if (
function isEnvironmentDefined(environment: string) {
Copy link
Member

Choose a reason for hiding this comment

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

@kpatticha Shouldn't this be called isEnvironmentUndefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah! I fixed it and forgot to push 😢
image

thanks for catching this!, will fix it in a follow-up PR

kpatticha added a commit that referenced this pull request Jan 28, 2023
## Summary

this time I did make sure I pushed it 🐒 

related to:
#149610 (comment)
kqualters-elastic pushed a commit to kqualters-elastic/kibana that referenced this pull request Feb 6, 2023
## Summary

Closes: elastic#146290

- Integrate Alert search bar
- Delete alerts status filters as it comes for free with the search bar
- Respect time range when fetching alert counts on service inventory and
service overview page
- as the search bar now supports time ranges, it's required to display
consistent data.

### Before 


![image](https://user-images.githubusercontent.com/3369346/214894397-6850274f-f701-481a-a12c-688c144f4c32.png)



### After


https://user-images.githubusercontent.com/3369346/214894788-5fcd42e2-b48f-434f-b38d-18579bfc280e.mov


TODO
- [x]
[getServiceAlerts](https://github.com/elastic/kibana/pull/149610/files#diff-82ef341af674bd7f203551b4d75b73d221a49e6ae4169e0c396e96abb04902bcR59-R67
) query doesn't include environment while the table respects that
filter. Check what's the correct way.

---------

Co-authored-by: kibanamachine <[email protected]>
kqualters-elastic pushed a commit to kqualters-elastic/kibana that referenced this pull request Feb 6, 2023
## Summary

this time I did make sure I pushed it 🐒 

related to:
elastic#149610 (comment)
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 ci:cloud-deploy Create or update a Cloud deployment enhancement New value added to drive a business result release_note:enhancement Team:APM All issues that need APM UI Team support v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Observability Alert Search Bar in APM Alerts tab
6 participants