Repository navigation
feat: rework getAllKeyValues and add filters populated from text indices #2643
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
27 commits
Select commit
Hold shift + click to select a range
8dc5e0d
feat: add intelligent router for getAllKeyValues; use text index to
knudtty 612bb2f
fix: remove key mv and map branches from recommended log and trace ro…
knudtty cfeda95
fix: rename functions for consistency
knudtty 1c7dbf8
add tests
knudtty d91e060
feat: use useFetchFacets in autocomplete
knudtty 9a42b40
Merge branch 'main' into aaron/filters-from-text-index
knudtty 6edaf6d
fix lint and docker builds
knudtty bcfb574
pr feedback
knudtty 4f8d9a5
fix: http 431 errors from too many query params solved by chunking
knudtty 6453af2
fix tests
knudtty 957a47b
fix behavior and tests
knudtty 24b51b4
fix: pass maxValuesPerKey through metadata keyvalue queries
knudtty 2c609a5
pr feedback
knudtty 8623cd3
fix e2e tests
knudtty e740aea
enable limits
knudtty a62bda2
fix
knudtty 4183842
fix tests
knudtty 8bfc0ae
fix
knudtty 5041d60
fix: use_multipart_params_auto set for clickhouse-js clients
knudtty cd71948
fix: hash large objects to reduce cache key size
knudtty a33924c
fix: keep same name to avoid issue of recreating an MV
knudtty abd9b08
add changeset
knudtty 57a438d
pr feedback
knudtty d40bf98
add integration tests for getAllKeyValues
knudtty f2c0648
Merge branch 'main' into aaron/filters-from-text-index
knudtty 95e5ec4
fix ci
knudtty 3a29b30
Merge branch 'main' into aaron/filters-from-text-index
knudtty 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@hyperdx/common-utils": minor | ||
| "@hyperdx/app": minor | ||
| --- | ||
|
|
||
| feat: upgrade filters and autocomplete to intelligently route queries through the best rollup |
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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| -- +goose Up | ||
|
|
||
| -- Map Attributes Key Value Rollup (all map columns in one table) | ||
| -- Key Value Rollup (many columns in one table) | ||
| CREATE TABLE IF NOT EXISTS ${DATABASE}.otel_logs_kv_rollup_15m | ||
| ( | ||
| `Timestamp` DateTime, | ||
|
|
@@ -17,58 +17,9 @@ ORDER BY (ColumnIdentifier, Key, Timestamp, Value) | |
| TTL Timestamp + ${TABLES_TTL} | ||
| SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1; | ||
|
|
||
| -- Key Only Rollup (derived from KV rollup) | ||
| CREATE TABLE IF NOT EXISTS ${DATABASE}.otel_logs_key_rollup_15m | ||
| ( | ||
| `Timestamp` DateTime, | ||
| `ColumnIdentifier` LowCardinality(String), | ||
| `Key` LowCardinality(String), | ||
| `count` UInt64, | ||
| INDEX idx_count_minmax count TYPE minmax GRANULARITY 1, | ||
| INDEX idx_timestamp_minmax Timestamp TYPE minmax GRANULARITY 1 | ||
| ) | ||
| ENGINE = SummingMergeTree | ||
| PARTITION BY toDate(Timestamp) | ||
| ORDER BY (ColumnIdentifier, Key, Timestamp) | ||
| TTL Timestamp + ${TABLES_TTL} | ||
| SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1; | ||
|
|
||
| CREATE MATERIALIZED VIEW IF NOT EXISTS ${DATABASE}.otel_logs_key_rollup_15m_mv TO ${DATABASE}.otel_logs_key_rollup_15m | ||
| AS SELECT | ||
| Timestamp, | ||
| ColumnIdentifier, | ||
| Key, | ||
| sum(count) as count | ||
| FROM ${DATABASE}.otel_logs_kv_rollup_15m | ||
| GROUP BY ColumnIdentifier, Key, Timestamp; | ||
|
|
||
| -- Single MV: CTE with UNION ALL across all columns, then aggregate | ||
| CREATE MATERIALIZED VIEW IF NOT EXISTS ${DATABASE}.otel_logs_attr_kv_rollup_15m_mv TO ${DATABASE}.otel_logs_kv_rollup_15m | ||
| AS WITH elements AS ( | ||
| SELECT | ||
| 'ResourceAttributes' AS ColumnIdentifier, | ||
| toStartOfFifteenMinutes(Timestamp) AS Timestamp, | ||
| replaceRegexpAll(entry.1, '\\[\\d+\\]', '[*]') AS Key, | ||
| CAST(entry.2 AS String) AS Value | ||
| FROM ${DATABASE}.otel_logs | ||
| ARRAY JOIN ResourceAttributes AS entry | ||
| UNION ALL | ||
| SELECT | ||
| 'LogAttributes' AS ColumnIdentifier, | ||
| toStartOfFifteenMinutes(Timestamp) AS Timestamp, | ||
| replaceRegexpAll(entry.1, '\\[\\d+\\]', '[*]') AS Key, | ||
| CAST(entry.2 AS String) AS Value | ||
| FROM ${DATABASE}.otel_logs | ||
| ARRAY JOIN LogAttributes AS entry | ||
| UNION ALL | ||
| SELECT | ||
| 'ScopeAttributes' AS ColumnIdentifier, | ||
| toStartOfFifteenMinutes(Timestamp) AS Timestamp, | ||
| replaceRegexpAll(entry.1, '\\[\\d+\\]', '[*]') AS Key, | ||
| CAST(entry.2 AS String) AS Value | ||
| FROM ${DATABASE}.otel_logs | ||
| ARRAY JOIN ScopeAttributes AS entry | ||
| UNION ALL | ||
|
Comment on lines
-48
to
-71
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are handled by text index introspection now and are quite expensive, safe to remove |
||
| SELECT | ||
| 'NativeColumn' AS ColumnIdentifier, | ||
| toStartOfFifteenMinutes(Timestamp) AS Timestamp, | ||
|
|
||
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.
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.
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.
Totally no use for this any longer now that we have text index introspection, it's in the ingestion hot path, it's best to just deprecate this
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.
Should we mark it as deprecated in the team settings / source configuration?