hey folks, I'm currently running a local instance ...
# ask-community
j
hey folks, I'm currently running a local instance of Prefect 3.2.2 with a postgres database, and I'm trying to emit a custom event in python as per the docs, but I'm not seeing the event in the UI or in the database. The code doesn't throw any errors, nor do I see any errors from logs for prefect (even with increased logging + debug mode). Is there something special that needs to be enabled/configured to use/view events on the OSS side?
n
hi @Jeffrey Lam on that version, things should be on by default is your client-side definitely talking to the right PREFECT_API_URL?
j
yes, it's currently set to my local instance
<http://localhost:4200/api>
n
hmm if you do
Copy code
prefect events stream --format text
and then emit the event, do you see it show up? e.g.
Copy code
» prefect events stream --format text
Subscribing to event stream...
2025-02-20T17:13:04.981979+00:00 hi test123
Copy code
» python -c "from prefect.events import emit_event;emit_event('hi', resource={'prefect.resource.id': 'test123'})"
j
yes I do see the event
okay I can see the event when I stream, but am I suppose to see it in the UI as well?
@Nate I've been digging into the prefect code, and I see there's a event persister service that writes events to the database. Does this service run by default? I can see in my configs that the persister is enabled (true), but when I look at the prefect server logs I don't see the debug message
Event persister started
n
okay I can see the event when I stream, but am I suppose to see it in the UI as well?
yeah generally you should be able to hmm there might be something going on, i can take a look
hi @Jeffrey Lam - this is our fault, due to a recent change in background service discovery https://github.com/PrefectHQ/prefect/pull/17240 3.2.7 will be released shortly with the fix
Copy code
» PREFECT_SERVER_LOGGING_LEVEL=DEBUG uvx prefect@3.2.7 server start

 ___ ___ ___ ___ ___ ___ _____
| _ \ _ \ __| __| __/ __|_   _|
|  _/   / _|| _|| _| (__  | |
|_| |_|_\___|_| |___\___| |_|

Configure Prefect to communicate with the server with:

    prefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>

View the API reference documentation at <http://127.0.0.1:4200/docs>

Check out the dashboard at <http://127.0.0.1:4200>



INFO:     Started server process [80155]
INFO:     Waiting for application startup.
.....
13:41:54.448 | DEBUG   | prefect.server.events.services.event_persister - Event persister started
this is now released! sorry about the disruption
j
thanks @Nate for the update, I'll give the new version a try