-
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] Default
async_insert
to true. Added related c…
…onfig option. (#33614) ### DEPENDS ON #33693, #33694 **Description:** Sets `async_insert` to true by default to enable [asynchronous inserts](https://clickhouse.com/docs/en/optimize/asynchronous-inserts). Because this value is being given a default, I have added a config option under the same name. Keep in mind that if `async_insert` is provided in `endpoint` or `connection_params` it will take precedence and ignore this new config option. This is similar to how the `database` config option behaves. The goal is to provide better insert performance by default, since not all users will know to set it in their DSN URL. This also opens the discussion to ___**whether or not this is a breaking change**___. Depending on the deployment's telemetry throughput, this could be an unexpected change that leads to [`TOO_MANY_PARTS`](https://clickhouse.com/docs/knowledgebase/exception-too-many-parts) errors. I don't expect this to be the case however, but I welcome any discussion about this concern. This PR is being resubmitted with suggestions from @crobert-1 and @dmitryax applied. Here are the extra changes with these suggestions applied: - Extracted unrelated changes into separate PRs - Updated `async_insert` to avoid using a `bool` pointer - Updated tests to be able to support these non-pointer-yet-still-optional test cases **Testing:** Ran integration tests. Also added an abundance of tests to check the behavior of `async_insert` when present in `endpoint`, `connection_params`, and exporter config. **Documentation:** - Updated README for all related changes Unrelated change, also updated README's SQL samples to use `sql` instead of `clickhouse` for the code samples to enable proper syntax highlighting. ClickHouse SQL is compatible with plain SQL.
- Loading branch information
1 parent
2604193
commit ba2b924
Showing
5 changed files
with
159 additions
and
28 deletions.
There are no files selected for viewing
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,33 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: breaking | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: exporter/clickhouse | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "Add `async_insert` config option to enable inserting asynchronously by default." | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [33614] | ||
|
||
# (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: | | ||
Adds `async_insert` config option to enable inserting asynchronously by default. | ||
To preserve the previous behavior, set `async_insert` to `false` in your config. | ||
When enabled, the exporter will insert asynchronously, which can improve performance for high-throughput deployments. | ||
The `async_insert` option can be set to `true` or `false` to enable or disable async inserts, respectively. The default value is `true`. | ||
Keep in mind this setting is added since the exporter now sets it to default. | ||
Async insert and its related settings can still be defined in `endpoint` and `connection_params`, which take priority over the new config option. | ||
# 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
Oops, something went wrong.