signoz icon indicating copy to clipboard operation
signoz copied to clipboard

Add basic support for secure clickhouse connections

Open features-not-bugs opened this issue 1 year ago • 7 comments

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

features-not-bugs avatar Dec 06 '23 18:12 features-not-bugs

Welcome to the SigNoz community! Thank you for your first pull request and making this project better. 🤗

welcome[bot] avatar Dec 06 '23 18:12 welcome[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 06 '23 18:12 CLAassistant

Please use ParseDSN from clickhouse https://github.com/ClickHouse/clickhouse-go/blob/5e9073dcd69a1082d59b5ee49b43534d82b5fb34/clickhouse_options.go#L110-L116

srikanthccv avatar Dec 28 '23 17:12 srikanthccv

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.

features-not-bugs avatar Dec 29 '23 06:12 features-not-bugs

Merged the latest commits from develop in, project builds successfully

features-not-bugs avatar Dec 29 '23 06:12 features-not-bugs

@srikanthccv Is it planned to be completed (merged) for next release?

akalitenya avatar Jan 14 '24 09:01 akalitenya

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.

srikanthccv avatar Jan 14 '24 15:01 srikanthccv

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?

Share

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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to 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.yaml file 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.

coderabbitai[bot] avatar Feb 24 '24 16:02 coderabbitai[bot]

thanks, please resolve the conflicts

srikanthccv avatar Feb 25 '24 01:02 srikanthccv

thanks, please resolve the conflicts

Done

features-not-bugs avatar Feb 25 '24 01:02 features-not-bugs

Congrats on merging your first pull request! minion-party We here at SigNoz are proud of you! 🥳

welcome[bot] avatar Feb 27 '24 18:02 welcome[bot]