feat(connector): single events table across namespaces #410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Single events table across namespaces.
ClickHouse recommendation is only to have one insert per second.
See: ClickHouse/ClickHouse#34170
This PR batches all inserts into a single monthly partition across all namespaces as:
This PR stores all namespace events into a single table partitioned by month:
Breaking Change:
This PR changes the query behind materialized views moving the meters.
As altering the
query
ofMaterializedViews
backed byAggregatingMergeTree
is currently unimplemented in ClickHouse, there is no straightforward path forward to migrate.We recommend creating new meters. Old meters remain queriable.
Migration:
If you
MUST
migrate follow:As pre-1.0.0 release, this breaking change requires manual migration.
1. Stop sink-worker or Kafka Connect
This stop ingestion to the ClickHouse DB. Events will queue up in Kafka topic, so you won't lose new data just delay meter aggregates.
2. Update Events Table in ClickHouse
Run the following command to update your ClickHouse DB:
3. Start OpenMeter With Recreate Config
Add the following to your
config.yaml
temporary.Starting OpenMeter with these settings can take longer.
4. Restart sink-worker
Restart sink-worker and remove
createOrReplaceMeter
andpopulateMeter
from your config.If you are stuck with migration, reach out on our Discord, and we will assist you.