-
Notifications
You must be signed in to change notification settings - Fork 31
Use kibana server hostname for puppeteer to access pages #99
Use kibana server hostname for puppeteer to access pages #99
Conversation
@@ -66,3 +66,5 @@ export enum TRIGGER_TYPE { | |||
} | |||
// https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-from-size.html | |||
export const DEFAULT_MAX_SIZE = 10000; | |||
|
|||
export const LOCAL_HOST = 'http://localhost:5601'; |
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.
Should we be hard-coding the host like this?
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.
Ideally, we should extract the server host/port from kibana.yml
, but the new platform applies some restrictions to access certain fields. More details can be found in this issue #98
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.
Can we get the local host from a window.location
or document
method instead? I think those should be fine to access in the new platform.
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.
That window.location
won't work on server side. The UI side still keeps the usage of window.location
which is fine.
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.
Ack, miss from me- forgot this was on server-side
@@ -1,4 +1,3 @@ | |||
import { async } from 'rxjs/internal/scheduler/async'; |
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.
Are the changes in this file related to the title of the PR? I feel this is a different optimization refactor
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.
That's just an unused import
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.
Not just this line, I'm referring to the other changes in the file as well- meant to highlight the whole file
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.
The other change is just rewriting the import to typescript style.
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.
LGTM- just some small comments and questions to address
Issue #, if available:
Currently the url for puppeteer to access is a complete url passed from UI, including the schema, hostname and port. However this brings some issues when deploying on a cloud service such as AWS ELB, which has settings for security group. Since puppeteer is only accessing the url from localhost, it doesn't even need to go the ELB first and route back to itself. Instead it can access
http://localhost:5601:/app/dashboard#/<dashboard_id>
directly.Description of changes:
LOCAL_HOST = "http://localhost:5601"
constant. However since the hostname and port number are configured inkibana.yml
file, which the new Kibana plugin platform doesn't provide access now. This issue is documented Access kibana.yml from plugin to read server.host, server.port and server.basePath #98 and tracked once there is a proper solution.dependency
todevDependency
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.