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

[Stack Monitoring] Use BasePath.publicBaseUrl for links generated by SM rules #127126

Closed
Tracked by #127224
miltonhultgren opened this issue Mar 8, 2022 · 1 comment · Fixed by #131154
Closed
Tracked by #127224
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@miltonhultgren
Copy link
Contributor

miltonhultgren commented Mar 8, 2022

Based on this SDH: https://github.com/elastic/sdh-kibana/issues/2664

Here is where the rule creates the link URL:

const globalStateLink = this.createGlobalStateLink(
`elasticsearch/indices/${shardIndex}`,
cluster.clusterUuid,
ccs
);

We grab the host from these global here:

return `${Globals.app.url}/app/monitoring#/${link}?_g=(${globalState.toString()})`;

These globals are defined here, coming from Kibana Core's getServerInfo function:

const { protocol, hostname, port } = coreSetup.http.getServerInfo();
const pathname = coreSetup.http.basePath.serverBasePath;
Globals._app = {
url: url.format({ protocol, hostname, port, pathname }),

In the docs for getServerInfo it says:

Information about what hostname, port, and protocol the server process is running on. Note that this may not match the URL that end-users access Kibana at. For the public URL, see [BasePath.publicBaseUrl](./kibana-plugin-core-server.basepath.publicbaseurl.md)<!-- -->.

We should change this code to make use of BasePath.publicBaseUrl instead.

Affected rules: https://github.com/elastic/kibana/search?q=globalStateLink

@miltonhultgren miltonhultgren added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Feature:Stack Monitoring labels Mar 8, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@smith smith added the bug Fixes for quality problems that affect the customer experience label Apr 14, 2022
@jasonrhodes jasonrhodes changed the title [Stack Monitoring UI] Large Shard Size alert gives wrong URL [Stack Monitoring] Use BasePath.publicBaseUrl for links generated by SM rules Apr 20, 2022
@miltonhultgren miltonhultgren self-assigned this Apr 28, 2022
miltonhultgren added a commit that referenced this issue May 2, 2022
* [Stack Monitoring] Use server.publicBaseUrl in Alert links (#127126)

* Use empty string as fallback value

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this issue May 24, 2022
…31154)

* [Stack Monitoring] Use server.publicBaseUrl in Alert links (elastic#127126)

* Use empty string as fallback value

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants