<@ULVA73B9P> I am self hosting prefect and have se...
# ask-marvin
w
@Marvin I am self hosting prefect and have set up a slack notification on error. When the error notification comes, the URL is wrong: Flow run URL: http://127.0.0.1:4200/api/flow-runs/flow-run/x I want the url to be my domain name (prefect.<domain>.io)
m
It seems that the provided excerpts from the Prefect documentation do not directly address how to configure the base URL for notifications when you have setup notifications in a self-hosted Prefect instance. The documentation mentions creating notifications and the types of notifications available, but does not directly cover how to change the base URL. Typically, this kind of configuration would involve setting an environment variable or a configuration setting within Prefect to use the desired base URL for links in notifications, rather than the default
<http://127.0.0.1:4200>
. To find the specific steps, let's check the Prefect GitHub repository for issues or discussions related to changing base URLs for notifications. Let's search the Prefect GitHub issues to see if there is any discussion or solution for setting a custom domain name for notifications. The search for issues related to changing the notification base URL or domain in Prefect's GitHub repository did not yield any relevant results. It's possible that this question hasn't been raised in that specific context, or it might not have been documented in an issue yet. To fix the issue of the incorrect URL in Slack notifications, the solution would typically involve setting the correct base URL for Prefect's UI. Below are steps that can generally be taken to address such a configuration setting: 1. Look for any environment variable settings in Prefect that allow you to define the base URL for the UI, such as
PREFECT_UI_URL
,
PREFECT_SERVER__UI_URL
,
PREFECT_CLOUD__UI_URL
, or something along those lines. This environment variable would be set to the desired base URL, such as
<https://prefect>.<domain>.io
. 2. If you're using Docker to run Prefect Server, you would set this environment variable in your Docker Compose or in the Docker configuration where you define your services. 3. If it's a Prefect agent or other deployment-related setting, it might be included in the agent deployment configuration or through the Prefect CLI when starting up the agent. 4. If the resolution isn't clear, it's good practice to consult the Prefect documentation for the most up-to-date information or even reach out on the Prefect community Slack for real-time help. Unfortunately, without a clear answer from the documentation or GitHub issues, I don't have a specific command or line of code to provide. Nonetheless, I would recommend checking Prefect's configuration documentation and environment variables to see if there's a relevant setting you can adjust to correct the flow run URL base in your notifications. If all else fails, reaching out to the Prefect community or support, if you have access, may be the next best step.
n
@William Fitzmaurice what is the value of
PREFECT_API_URL
on the machine where your server is running?
w
@Nate I'm running the server from a docker container. These are my settings:
Copy code
ENV PREFECT_SERVER_API_HOST=0.0.0.0
ENV PREFECT_UI_URL=<http://127.0.0.1:4200/api>
ENV PREFECT_API_URL=<http://127.0.0.1:4200/api>
And I'm using AWS route53 to route to the server through a domain name
n
i _think_ you'd want to set
PREFECT_UI_URL
to be prefixed with your domain
w
Okay great I’ll try that
Thanks