0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-30 19:41:46 +01:00
Commit Graph

11 Commits

Author SHA1 Message Date
Ben White
16870d63fc
feat: Plugin server services refactor - take 2 (#24737) 2024-09-03 11:00:50 +02:00
Ben White
3f56346512
chore: Reverts "Plugin server services refactor (#24638)" (#24733) 2024-09-02 08:43:52 +00:00
Ben White
4684a2bc0d
chore: Plugin server services refactor (#24638) 2024-09-02 09:56:13 +02:00
Brett Hoerner
5b5d0d43a3
chore(plugin-server): make it easier to run multiple plugin-server instances locally (#17456)
* chore(plugin-server): allow customizing the HTTP server port

* chore(plugin-server): add NO_WATCH mode for development

* fix: http-server test
2023-09-15 08:55:46 -06:00
Harry Waye
7ba6fa7148
chore(plugin-server): remove piscina workers (#15327)
* chore(plugin-server): remove piscina workers

Using Piscina workers introduces complexity that would rather be
avoided. It does offer the ability to scale work across multiple CPUs,
but we can achieve this via starting multiple processes instead. It may
also provide some protection from deadlocking the worker process, which
I believe Piscina will handle by killing worker processes and
respawning, but we have K8s liveness checks that will also handle this.

This should simplify 1. prom metrics exporting, and 2. using
node-rdkafka.

* remove piscina from package.json

* use createWorker

* wip

* wip

* wip

* wip

* fix export test

* wip

* wip

* fix server stop tests

* wip

* mock process.exit everywhere

* fix health server tests

* Remove collectMetrics

* wip
2023-05-03 14:42:16 +00:00
Harry Waye
d14494afc2
fix(plugin-server): add shutdown failsave timeout (#12667)
* fix(plugin-server): add shutdown failsave timeout

We were having an issue where a Kafka version upgrade caused the
plugin-server to hang on shutdown. This was because the Kafka producer
was not able to flush its messages to Kafka. This commit adds a timeout
to the shutdown process, so that the plugin-server will exit even if
something hangs.

See https://posthog.slack.com/archives/C046SERP277/p1667878901739969 for
details

I wasn't exactly sure how to make this a little more testable, but there
is clearly a blind spot for certain failure cases.

* Actually call the shutdown sequence

* wip
2022-11-08 12:19:55 +00:00
Yakko Majuri
9a33696351
feat: split plugin server healthcheck into readiness and health (#10638)
* feat: splut plugin server healthcheck into readiness and health

* add ingestion capability to test
2022-07-07 10:39:22 +00:00
Karl-Aksel Puulmann
f2ddc532d3
feat(plugin-server): Allow running plugin server in a different mode (#9946)
* Add PLUGIN_SERVER_MODE

* Make capabilities dependent on PLUGIN_SERVER_MODE

* Subscribe to kafka-events topic

* runAsyncHandlersEventPipeline

* Test fixup: fix typing error

* Test fixup: flush right after queueing message

* Parse clickhouse event correctly

* Different consumer group ids for kafka queue based on mode

* Set different prompts for different modes

* Capability for http, disabled in tests

* Elements chain handling in async ingestion

* Test for runner.test.ts

* Update a snapshot

* Update plugin-server/README.md

Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>

* Solve review-related issues

* Fix a test

* Fix imports

* Capabilities test fix

* Update tests

Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>
2022-05-25 14:50:36 +03:00
Yakko Majuri
b1b82a31bc
feat(plugin-server): add kafka healthcheck (#9581)
* feat: add kafka healthcheck to plugin server healthcheck

* no-op healthcheck for now

* add tests

* cleanup

* run healthcheck in http server

* update timeout

* fixes

* Update plugin-server/src/main/utils.ts

* fix healthcheck

* fixes
2022-05-06 13:50:24 +00:00
Yakko Majuri
404fe90ffd
plugin server readiness endpoint (#8819) 2022-03-03 12:35:38 +00:00
Yakko Majuri
003f0682c4
Plugin server health endpoint (#7983)
* show last event ingested timestamp in system status

* wip plugin server healthcheck endpoint

* plugin server health endpoint

* fix readme prettier issue

* update tests

* move server.listen

* fixes, tests

* longer staleness default

* change endpoint to _health
2022-01-26 09:30:01 -03:00