-
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
[Stack Monitoring] Use server.publicBaseUrl in Alert links #131154
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,6 +344,9 @@ export class BaseRule { | |
if (ccs) { | ||
globalState.push(`ccs:${ccs}`); | ||
} | ||
return `${Globals.app.url}/app/monitoring#/${link}?_g=(${globalState.toString()})`; | ||
|
||
const baseUrl = Globals.app.url || '(server.publicBaseUrl)'; | ||
|
||
return `${baseUrl}/app/monitoring#/${link}?_g=(${globalState.toString()})`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the input may be coming from the user (cloud sets the kibanaBaseUrl and it's not overridable by customers), would be best to use something like a relative URL "joiner" (not sure what the current flavor would be). Reason is, the customer may or may not be adding an trailing I believe I've cheated and used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, if that's the case, shouldn't need a special join! |
||
} | ||
} |
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.
I don't know how we should react if the setting isn't configured, the default is simply 'undefined'.
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.
We could use the serverInfo as a fallback, or make it a relative path URL.
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.
We expose the kibana base path itself as an action context variable within alerting, and leave it "set" to
undefined
if the config is not set. It renders as the empty string. Customers can "optionally" add it via a section block like, so it won't render anything if it'sundefined
:Note you can one-line this multi-line template.