signoz
signoz copied to clipboard
Add basic support for secure clickhouse connections
Summary
Add basic support for secure clickhouse connections using DSN queries
Related Issues / PR's
https://github.com/SigNoz/signoz/issues/1855
Screenshots
NA
Affected Areas and Manually Tested Areas
Query service package will need to be tested to ensure three additional connection combinations work as intended, connecting with TLS Enabled and with either TLS verification enabled or disabled, although no real logic has been written here, it's simply adding to clickhouse-go's configuration struct
Welcome to the SigNoz community! Thank you for your first pull request and making this project better. 🤗
Please use ParseDSN from clickhouse https://github.com/ClickHouse/clickhouse-go/blob/5e9073dcd69a1082d59b5ee49b43534d82b5fb34/clickhouse_options.go#L110-L116
Please use ParseDSN from clickhouse https://github.com/ClickHouse/clickhouse-go/blob/5e9073dcd69a1082d59b5ee49b43534d82b5fb34/clickhouse_options.go#L110-L116
This makes much more sense, I've made the changes as requested and removed the redundant fields from configuration objects and cmd flags that we're being propagated down to the clickhouseReader.
Merged the latest commits from develop in, project builds successfully
@srikanthccv Is it planned to be completed (merged) for next release?
Sorry I missed the last update. This will be a breaking change. Let me think about this and get back soon but can't promise if this will be merged in next release.
Walkthrough
The recent update focuses on refining the connection handling with ClickHouse in the query service, particularly enhancing how connection parameters are set and managed. It simplifies the configuration process by directly parsing the datasource URL for connection options and streamlines the API handler by removing specific connection fields. Additionally, it adjusts default connection values to offer more flexibility and clarity in service setup and operation.
Changes
| File Path | Change Summary |
|---|---|
.../clickhouseReader/options.go.../http_handler.go.../main.go |
Refactored ClickHouse connection option handling for improved clarity and flexibility. Removed maxIdleConns, maxOpenConns, dialTimeout fields from APIHandler struct initialization. Updated default values and flag descriptions in main() function. Added extra newline for clarity in http_handler.go. |
🐰🎉
In the land of code where data streams flow,
A rabbit hopped, making changes glow.
"Refactor, streamline," it cheerfully said,
As clearer paths it chose to tread.
Now connections hum with newfound grace,
Thanks to the rabbit's steady pace.
🌟🐾
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit-tests for this file.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit tests for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository from git and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit tests.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (invoked as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
CodeRabbit Discord Community
Join our Discord Community to get help, request features, and share feedback.
thanks, please resolve the conflicts
thanks, please resolve the conflicts
Done
Congrats on merging your first pull request!
We here at SigNoz are proud of you! 🥳