-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[exporter/clickhouse] Update default logs table schema (#33611)
**Description:** Closes #32215 This PR updates the default `otel_logs` table schema. The intent of this change is to provide a good starting point for users to [***create their own schema***](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/clickhouseexporter#schema-management). This schema works as-is, but should be tuned to fit the final workflow when querying (specifically the indices, `TTL`, and `ORDER BY`). There are no breaking changes, this schema is compatible with the previous `INSERT` statement. This does not affect existing users, only new users that have `create_schema` enabled in the config. Notable changes: - 2 new Timestamp columns have been added for `Date` and `DateTime` types. Nanoseconds `Timestamp` is preserved. This does not affect the `INSERT` since these are derived by `DEFAULT` from `Timestamp`. - Partitioning has been optimized to use a larger time range, based on the new `TimestampDate` time - `TTL` is now based on `TimestampTime` - Data types for `TraceFlags` and `SeverityNumber` have been reduced to a `UInt8`, since this is all that is required by the OTel specification. - String-like columns have been changed to `LowCardinality` where appropriate - `ORDER BY` has been reduced to only `TimestampDate` and `TimestampTime`. This offers good performance as-is, but if you have a specific workflow that depends on `ServiceName` for example, feel free to add it at as the first column. - Updated the TTL expression generator, dependent functions will need to convert to DateTime type manually (dependent code has been updated for this) **Testing:** - Updated integration tests to include new timestamp columns Integration tests are disabled, but I fixed them locally to test that this change works as intended. Unit tests are passing as well. **Documentation:** - Updated README quick-start queries to use the more efficient `TimestampTime` column - Example DDL has been updated
- Loading branch information
1 parent
5c0aec1
commit 2c274ba
Showing
8 changed files
with
90 additions
and
53 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
.chloggen/clickhouseexporter_update_default_logs_table.yaml
This file contains 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,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: clickhouseexporter | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Updated the default logs table to a more optimized schema | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [33611] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: Simplified data types, improved partitioning and time range queries. | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
This file contains 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 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 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 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 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 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 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