-
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
Ability to generate URLs in alert action parameters #49392
Comments
Pinging @elastic/kibana-stack-services (Team:Stack Services) |
I think we would eventually want a link back to the original Kibana home page, or perhaps even a home page for a space, if that's all we could get if we end up getting #45815. Unfortunately, we'll need to do a little design work on where that would appear in the "context" passed to the action. We probably would want an entirely new object passed in, I'm thinking. |
Adjusting the Mustache template values may be all we need. This is what we do currently: https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/alerting/server/lib/transform_action_params.ts#L29. We could either keep adding flat values to allow |
See also: #25247 which longer term may provide a solution |
Related to #25247 |
Per #64370, would be nice to generate links to the alert details page and the alert management page:
|
It looks like #25247 is now resolved, we should see if that suits our uses cases. |
The pluggable URL service will be available on the server side once #59453 is completed. |
I had a chat with the App Architecture team last week. The work done for URL generators (#59453) is mostly for capturing / migrating app state and deep links. What we need is mostly the base URL of Kibana. After chatting with @kobelb, the best approach seems to be the following:
The R&D part here would be allowing the optional EDIT: We may not require #45815 anymore. |
I don't fully understand how this would work. Is the idea we would capture the URL when an alert is created to save the URL so we can inject it into action parameters? This obviously won't work for alerts created via I like the idea of somehow using Lastly, @matschaffer noted offline that cloud already passes the kibana URL around in various internal configs already - we'll certainly want to take advantage of that so that cloud deployments will be zero-config for this setting. We'll have to work with cloud folks to figure out the best way to pass this in. |
@pmuellr just for clarification, the internal configs I sent earlier are just for specific deployments. But yes, ideally we should be able to link back to the kibana that generated any alert. We should probably keep this configurable in the event of people using https://github.com/bitly/oauth2_proxy or a similar proxy for typical kibana access. |
Also window.location seems like it might preclude managing the alert via git (which we do exclusively), so that solution sounds less than ideal. |
I'm typically thinking about this as being able to provide a link to the alert details (eg, in a slack/email message), but even better for solution-based alerts (most of them!), it would be nice to have a link to a solution page relevant to the alert. So it seems like we'll need to think about alerts providing an array of links, which could then (somehow) be rendered into relevant action parameters. We can provide a "free" link to the alert details, along with whatever the alert provides. For index threshold, it would be nice to provide a link to a discover page that showed "relevant" documents, used the alerts window / interval for bucketing, etc. |
Also note - it would probably be useful to provide these links within the alert details page as well. I suppose that could mean we may need to provide two URLs for a particular Kibana page - one that we use in email / slack / etc, and another that would be used to navigate to the same page, but staying within Kibana so no page reload would occur. I'm assuming those two "urls" could be different. |
Moving from |
proof of concept in this PR |
resolves elastic#49392 Adds the top-level mustache variable `kibanaBaseUrl` for action parameter mustache templates. The value comes from Kibana config, which, if not set will result in this variable having the value `undefined`.
…exposed base URL (elastic#90525) resolves elastic#49392 Adds the top-level mustache variable `kibanaBaseUrl` for action parameter mustache templates. The value comes from Kibana config, which, if not set will result in this variable having the value `undefined` which will be rendered as an empty string.
…exposed base URL (#90525) (#91563) resolves #49392 Adds the top-level mustache variable `kibanaBaseUrl` for action parameter mustache templates. The value comes from Kibana config, which, if not set will result in this variable having the value `undefined` which will be rendered as an empty string.
We'll need to eventually allow users to build URLs within emails, slack messages, etc that point to Kibana. In order to do this, we'll need some functions or pre-defined variables within the mustache templates to help building URLs back into the application.
Currently blocked by #45815.
The text was updated successfully, but these errors were encountered: