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

[Infra UI] Adding time ranges to detail links #24237

Merged
merged 8 commits into from
Oct 23, 2018

Conversation

simianhacker
Copy link
Member

@simianhacker simianhacker commented Oct 18, 2018

This PR is needed by the @elastic/apm team

The URL format for the detail pages will be:

/app/infra#/link-to/host-detail/{hostname}?to={toTimestamp}&from={fromTimestamp}

- Adds timeranges to hosts, containers, and pods links
- Fixes elastic#24228 - Typos and what not prevented urls from working
@simianhacker
Copy link
Member Author

@skh @weltenwort @XavierM I added all three of you to this PR but only one of you needs to review it. First come first review.

@simianhacker
Copy link
Member Author

@makwarth Once this PR is merged I can get you that new URL.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

const to = getToFromLocation(location);
const from = getFromFromLocation(location);
const args =
to && from ? `?metricTime=(autoReload:!f,time:(from:${from},interval:>%3D1m,to:${to}))` : '';
Copy link
Member

Choose a reason for hiding this comment

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

This seems to encode a lot of knowledge about the structure of the url, which is owned by the <WithMetricsTimeUrlState> container. Faced a similar situation in

const searchString = compose(
replaceLogFilterInQueryString(`${configuredFields.host}: ${match.params.hostname}`),
replaceLogPositionInQueryString(getTimeFromLocation(location))

which I tried to solve by defining the serialization function alongside the container in

export const replaceLogPositionInQueryString = (time: number) =>
Number.isNaN(time)
? (value: string) => value
: replaceStateKeyInQueryString<LogPositionUrlState>('logPosition', {
position: {
time,
tiebreaker: 0,
},
});

while re-using the common replaceStateKeyInQueryString function. That way a change of the serialization format would not break the redirection components.

Do you think something like this would be applicable here and in the corresponding functions RedirectToHostDetail and RedirectToPodDetail too?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@simianhacker
Copy link
Member Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@simianhacker
Copy link
Member Author

jenkins test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

Works as expected if you specify to and from or none of them. 👍

If only one of them is specified, it is ignored. I guess that's intentional and fits our use cases?

const to = getToFromLocation(location);
const from = getFromFromLocation(location);
return to && from
? `?metricTime=(autoReload:!f,time:(from:${from},interval:>%3D1m,to:${to}))`
Copy link
Member

Choose a reason for hiding this comment

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

It would really be awesome if we could abstract away that manual rison construction using the replaceStateKeyInQueryString function, but this works too.

Copy link
Contributor

@XavierM XavierM left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@simianhacker simianhacker merged commit 3a6a3ea into elastic:master Oct 23, 2018
simianhacker added a commit to simianhacker/kibana that referenced this pull request Oct 23, 2018
* [Infra UI] Adding time ranges to detail links

- Adds timeranges to hosts, containers, and pods links
- Fixes elastic#24228 - Typos and what not prevented urls from working

* remove argument hard coded formatting

* Cleaning up query arg generation

* Adding missing file

* removing rison hard coded string
simianhacker added a commit that referenced this pull request Oct 24, 2018
* [Infra UI] Adding time ranges to detail links

- Adds timeranges to hosts, containers, and pods links
- Fixes #24228 - Typos and what not prevented urls from working

* remove argument hard coded formatting

* Cleaning up query arg generation

* Adding missing file

* removing rison hard coded string
XavierM added a commit that referenced this pull request Oct 24, 2018
* fixing other bucket filters (#24217)

* fixing other bucket filters

* adding selenium tests

* using lodash flatten

* using lodash flatten

* fixing based on tims review

* Fix functional tests

* [ML] Fixes font size of headings in anomalies table expanded row (#24390)

* Use metric indices when displaying metrics in the waffle map (#24251)

* Add drilldown to waffle map groupings (#24301)

* Resolve known APIs (#24398)

* Fix: Use basepath from state for socket path (#24369)

Closes #23168

This PR uses the `basePath` constant from Angular to mount the client socket instance, allowing it to connect correctly even in when using a Space.

### Workpad correctly loading in a Space
![screenshot 2018-10-22 15 57 00](https://user-images.githubusercontent.com/404731/47324055-251a3f80-d613-11e8-9fb0-0b0eaa3b974d.png)

### List of workpads restricted to a space
![screenshot 2018-10-22 13 49 54](https://user-images.githubusercontent.com/404731/47319741-50496280-d604-11e8-8966-83ef3a9fb320.png)

### List of workpads restricted to default space
![screenshot 2018-10-22 13 50 37](https://user-images.githubusercontent.com/404731/47319747-593a3400-d604-11e8-960d-385c80c7638a.png)

* [ML] Fixes check for lower memory limit. (#24323)

- Fixes the job validation for the lower bound of the model memory limit. Previously the check was against zero, now it's again less than 1MB, which is the same as the backend expects.
- If the user entered model memory limit is less than half the value of the estimated model memory limit, a warning type message gets triggered. If the user entered model memory limit is more than half the value but less then the actual value of the estimated model memory limit, then the already existing info type message is shown. The unit tests have been updated to reflect that behavior.

* Euify and Reactify Query Bar Component (#23704)

Implements query bar portion of https://elastic.github.io/eui/#/layout/header. Filter bar will come in another PR.

Fixes #14086

Re-implements our query bar component in React using some EUI components. Existing typeahead and suggestion styles were copied over 1:1 for now after talking with Dave about it. In this PR I focused on reaching feature parity with the existing query bar. Some additional work would be needed before we could move this into EUI as a generic component that could be consumed by other plugins.

Still needs some new tests and I suspect some old tests will need to be updated, but other than that this PR is functionally complete and ready for reviews.

* Add latency to index and node Elasticsearch stats (#22625)

Closes #22503

* [Infra UI] Adding time ranges to detail links (#24237)

* [Infra UI] Adding time ranges to detail links

- Adds timeranges to hosts, containers, and pods links
- Fixes #24228 - Typos and what not prevented urls from working

* remove argument hard coded formatting

* Cleaning up query arg generation

* Adding missing file

* removing rison hard coded string

* Make sure Vega tooltip isn't cut off (#24409)

Make sure the vega options dropdown menu is visible

* refactor infra folder to an ingest folder who allow multiple products under it

* fix lint error

* remove my temp folder

* fix link for icon

* rename xpack.infra or xpack/infra to xpack.ingest or xpack/ingest

* update to ingest

* no more infra

* change graphql endpoint

* fix test path

* fix path for xpack infra test
@simianhacker simianhacker deleted the add-time-to-detail-linkto branch April 17, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants