-
Notifications
You must be signed in to change notification settings - Fork 1
feat(ch): use latest clickhouse exporter schema #104
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6b7f6ae
feat(ch): use latest clickhouse exporter schema
Vunovati 787e927
fix: tests
Vunovati 48145d4
Merge branch 'main' into feat/use-latest-collector
Vunovati cab4d87
Merge remote-tracking branch 'origin/main' into feat/use-latest-colle…
Vunovati e819676
feat(ch): use latest clickhouse exporter 0.150.1
Vunovati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/clickhouse-datasource/migrations/001_add_event_name_to_otel_logs.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| -- Migration: Add EventName column to otel_logs | ||
| -- Required when upgrading OTEL collector from v0.136.0 to v0.148.0 | ||
| -- Run BEFORE starting the new collector version. | ||
| -- | ||
| -- ClickHouse ALTER TABLE ADD COLUMN is online and non-blocking. | ||
| -- Existing rows get the default empty string value. | ||
| -- | ||
| -- NOTE: This script assumes the correct database is selected in the client | ||
| -- context (e.g. via `USE otel_default` or the `--database` CLI flag). | ||
| -- If running from a different context, qualify the table name: | ||
| -- ALTER TABLE otel_default.otel_logs ADD COLUMN IF NOT EXISTS ... | ||
|
|
||
| ALTER TABLE otel_logs ADD COLUMN IF NOT EXISTS EventName String CODEC(ZSTD(1)) AFTER LogAttributes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # ClickHouse Migrations | ||
|
|
||
| ## 001 - Add EventName to otel_logs | ||
|
|
||
| **File:** `001_add_event_name_to_otel_logs.sql` | ||
|
|
||
| Adds the `EventName` column required by OTEL collector v0.148.0+. | ||
|
|
||
| ### Running the migration | ||
|
|
||
| The SQL file assumes the correct database is selected in the client context. Use one of: | ||
|
|
||
| ```bash | ||
| # Via clickhouse-client with --database flag | ||
| clickhouse-client --database=otel_default < 001_add_event_name_to_otel_logs.sql | ||
|
|
||
| # Or prefix the table name manually | ||
| ALTER TABLE otel_default.otel_logs ADD COLUMN IF NOT EXISTS EventName String CODEC(ZSTD(1)) AFTER LogAttributes; | ||
| ``` | ||
|
|
||
| ### Post-migration deprecation | ||
|
|
||
| Once all production databases have been migrated and the new collector is running everywhere, the following backward-compatibility code can be removed: | ||
|
|
||
| | Item | File | Change | | ||
| | ------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------- | | ||
| | `EventName` optional → required | `packages/core/src/denormalized-signals-zod.ts` | Change `.optional()` to just `.string()` | | ||
| | `EventName` optional → required | `packages/clickhouse-datasource/src/ch-row-schemas.ts` | Change `chOptionalString` to `z.string()` | | ||
| | Migration test | `packages/clickhouse-datasource/src/migration.integration.test.ts` | Delete entirely | | ||
| | Old collector constant | `packages/clickhouse-datasource/src/test/constants.ts` | Remove `OTEL_COLLECTOR_VERSION_OLD` | | ||
| | This migration script | `packages/clickhouse-datasource/migrations/001_add_event_name_to_otel_logs.sql` | Archive (keep for history) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.