I'm running prefect server on a EC2 machine using ...
# prefect-server
j
I'm running prefect server on a EC2 machine using
--expose
and connecting to the UI using the server IP address on port
8080
. All that works fine, however I noticed that the url in Slack notifications are using
<http://localhost:4200>
. How can I configure this part?
What is also confusing about this is that the docker output for prefect server shows
Visit <http://localhost:8080> to get started
. So why does the Slack url differ in port?
I saw this code in https://github.com/PrefectHQ/server/blob/1acf3a83134b892aef828440bc9ef46e487b7b5c/src/prefect_server/api/cloud_hooks.py#L255
Copy code
message_link = (
        f"{server_config.api.url}/{event.tenant.slug}/flow-run/{event.flow_run.id}"
    )
I guess my question is why is it using the API url instead of the UI url? Since the link should be to the web UI not to the API.
k
4200 is where the API lives, not necessarily Slack messages. You connect to the UI externally, but the UI makes requests to the configured. So this shouldn’t be pointing to the UI, it should be pointing to the API. This should be configured where the flow is running.
j
Maybe I need to give a bit more context with a screenshot. I've configured a Slack Cloud Hook on a Flow to trigger on a Failed state. And this is what the Slack notification looks like. So the issue I'm encountering is that the
Link
doesn't actually link to the Web UI. Since the Web UI is hosted on port 8080. Port 4200 is for the API. Also the link should not be
localhost
but rather the server IP.
But the link there is clearly intended to be a UI link not an API link.
a
are you just getting started with Prefect? you may start with Prefect 2.0 prefect2 directly rather than with Prefect Server
j
I think I would prefer to stay with 1.0 branch for now at least until 2.0 is out of beta phase. So I guess my question still stands. Is this the intended behavior of the Slack cloud hook to pass an API url rather than a UI url? Or is this a bug?
a
I see what you mean: it should be port 8080 in the URL rather than 4200? if so, yes likely a bug. If you'd like to contribute a fix, it's in Server repo under Cloud Hooks. Well-spotted and you're right it should be 8080 to point to the UI