Skip to content
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

[exporter/clickhouse] Default async_insert to true. Added related config option. #33614

Merged

Conversation

SpencerTorres
Copy link
Member

@SpencerTorres SpencerTorres commented Jun 18, 2024

DEPENDS ON #33693, #33694

Description:
Sets async_insert to true by default to enable 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 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.

@crobert-1
Copy link
Member

Note for future reference, this is a continuation of #32340

@SpencerTorres
Copy link
Member Author

Looks like the README got merged incorrectly, I've removed the duplicate 👍

@SpencerTorres
Copy link
Member Author

@dmitryax did some git surgery to hopefully extract all these changes into separate PRs. The PRs do build on one another, so I've ordered them so that they can be merged without breaking main.

@SpencerTorres SpencerTorres force-pushed the config-async-inserts branch 2 times, most recently from 902da38 to ed997a9 Compare June 24, 2024 18:15
dmitryax added a commit that referenced this pull request Jun 24, 2024
#### EXTRACTED FROM #33614 
#### DEPENDS ON #33693 

**Description:**

A follow-up to #32282 that changes `create_schema` from `*bool` to
`bool`, while also properly using the default config / factory.

**Testing:** 
- Updated tests

---------

Co-authored-by: Dmitrii Anoshin <[email protected]>
@SpencerTorres SpencerTorres force-pushed the config-async-inserts branch 2 times, most recently from 8b9ee99 to 8102c6e Compare June 25, 2024 17:15
@dmitryax
Copy link
Member

@hanjm @Frapschen PTAL

Copy link
Member

@hanjm hanjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SpencerTorres
Copy link
Member Author

Thanks for reviewing! I don't have permission to merge, but after this is merged we can do #33615

@crobert-1 crobert-1 added the ready to merge Code review completed; ready to merge by maintainers label Jun 27, 2024
@TylerHelmuth TylerHelmuth removed the ready to merge Code review completed; ready to merge by maintainers label Jul 1, 2024
@SpencerTorres SpencerTorres force-pushed the config-async-inserts branch from 8102c6e to 1b04615 Compare July 1, 2024 19:07
@SpencerTorres
Copy link
Member Author

Latest suggestions applied + rebased, hopefully we can get this merged asap since it's been open for a while. Thanks!

@TylerHelmuth TylerHelmuth merged commit ba2b924 into open-telemetry:main Jul 1, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 1, 2024
@SpencerTorres SpencerTorres deleted the config-async-inserts branch July 2, 2024 01:46
andrzej-stencel pushed a commit that referenced this pull request Jul 3, 2024
…33615)

**Description:**

*NOTE: Depends on merging of #33611, #33614, and #33648*

Logs configuration is unlikely to change further with the new
recommendation of [manual schema
config](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/clickhouseexporter#schema-management).
The logs component of the exporter has proven stability, as seen in
deployments such as [ClickHouse's
Loghouse](https://clickhouse.com/blog/building-a-logging-platform-with-clickhouse-and-saving-millions-over-datadog).

With these points in mind, I suggest we upgrade the status to `beta` for
logs. Traces and metrics can remain `alpha` for now.

**Documentation:**
- Updated metadata.yaml
- Updated README
- Small unrelated change: added/refactored a section that covers tool
visualization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants