https://prefect.io logo
#prefect-server
Title
# prefect-server
p

Prasanth Kothuri

12/20/2021, 7:35 PM
I enabled slack notification on prefect flows, I receive notification when the state changes which is perfectly fine, however the link there points to localhost:8080 how do I properly link so that when some clicks they can go to that task run ? thanks
Copy code
<http://localhost:8080/default/task-run/bcb01c03-6507-40c3-8c31-c2a0a37a9868>
a

Anna Geller

12/20/2021, 7:49 PM
how did you start your Server? you can set the Server host in your config.toml and use the --expose flag when starting Server to ensure it will be exposed to all services
p

Prasanth Kothuri

12/20/2021, 8:00 PM
I started the server with expose flag and I can access the UI at
<http://my_host:8080>
it is only the links in the slack notifications that are pointing to
localhost:8080
which variable/parameter I need to set ?
a

Anna Geller

12/20/2021, 8:55 PM
in that case maybe you can adjust it directly in your state handler?
a

Amanda Wee

12/20/2021, 9:13 PM
I think I had a similiar problem and solved it by setting the environment variable
PREFECT__SERVER__UI__HOST
If you look at the code, the
base_url
in the
Client
get_cloud_url
method takes
prefect.config.server.ui.endpoint
when not using Prefect Cloud, and the slack formatter calls that method, so the environment variable I mentioned sounds correct.
upvote 1
2 Views