-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analytics in Postgres #7594
Analytics in Postgres #7594
Conversation
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.
Looking good. I’ll test some once the CI is green
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.
I tested some locally and saving the events of the own instance works.
Did you also test the ingesting? Do you have steps to test for that? Ah, I see them now. Will do some more tests now!
I did see some Unsuccessful WS request to https://events-relay.webknossos.org/events (ID: 0).Status: 500.
in the logging. Did something change there?
I also added some comments on the code.
Also, reminder for the migration guide
Testing the ingest worked with the fetch you provided. It also worked with wrong api keys and wrong uris, though. I couldn’t immediately spot the error in the code. Can you reproduce this? If so, maybe you can debug why it is not strictly checked. |
URIs that are not in the list are not protected. For these, you can send events with any key. |
POST /api/analytics/ingest
route to accept events from other wk instances, just like the current event-relay doesSteps to test:
fetch("/api/analytics/ingest", {method:"POST", headers:{"content-type": "application/json"}, body: JSON.stringify({"events":[{"event_type":"open_annotation","user_id":"123456789012345678901234","time":"1706510609682","user_properties":{"organization_id":"123456789012345678901234","is_organization_admin":false,"is_superuser":false,"webknossos_uri":"https://webknossos.org"},"event_properties":{"annotation_id":"123456789012345678901234","annotation_owner_multiuser_id":"123456789012345678901234","annotation_dataset_id":"123456789012345678901234"},"session_id":1706510609681}], "api_key": "dingdong"})})
(also try with otherwebknossos_uri
andapi_key
)TODOs:
(Please delete unneeded items, merge only when none are left open)