-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Plugin log entries #3482
Plugin log entries #3482
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.
I think we can go in this direction. The only thing we'll definitely need to add then is some decent TTL restrictions in clickhouse (30 days?) and a script to delete old rows from postgres, like we have now for session recordings. The size of this table should probably also be added to the system status page.
Also, into the models, I'd add another field for |
Great, I'll add the rest of this solution after putting #3486 up for review. |
Added support for system (plugin server) logs too (PostHog/plugin-server#333): |
e3df7cc
to
6b9b7aa
Compare
This is ready. @macobo After the migration is ran, the logs won't be produced yet – they have to be enabled with env var |
@macobo @fuziontech can we do anything from our side to help move this along? Doing things manually once would also be fine perhaps.... though, yeah, VPCs... |
Sorry for the delays, have had my own fires to fight. Will get this in soon! :) |
Changes
This is
a proposedthe accepted and awaiting complete implementation in this PR (and a complimentary one in https://github.com/PostHog/plugin-server) data model to resolve PostHog/plugin-server#72.The unit of plugin logging is a single plugin log entry (
PluginLogEntry
model for Postgres and a schema-wise drop-in equivalentplugin_log_entries
topic →kafka_plugin_log_entries
table →plugin_log_entries
table setup in Kafka+ClickHouse).This looks like some complexity at first, but it's straightforward compared to fighting Postgres's scale limitations:
INSERT
s/SELECT
s onposthog_pluginlogentry
, and we know they won't have problems with scale.console
method call in plugin server,SELECT
relevant entries from table in Django server".Kafka+ClickHouse parts adapted from session recording events handling, which is similarly simple (though actually logs are far better for this infrastructure than session recording, which is too storage space-intensive).