Skip to content

feat: allow to use secrets in clickhouse-logger plugin#12951

Merged
moonming merged 6 commits into
apache:masterfrom
vlad-vinogradov-47:feat-clickhouse-logger-secrets
Mar 16, 2026
Merged

feat: allow to use secrets in clickhouse-logger plugin#12951
moonming merged 6 commits into
apache:masterfrom
vlad-vinogradov-47:feat-clickhouse-logger-secrets

Conversation

@vlad-vinogradov-47

Copy link
Copy Markdown
Contributor

Description

This will allow to store credential information like user/password in environment variables or HashiCorp Vault.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

This will allow to store credential information like user/password in
environment variables or HashiCorp Vault.
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. plugin labels Jan 29, 2026
Comment thread t/plugin/clickhouse-logger3.t Outdated
Baoyuantop
Baoyuantop previously approved these changes Feb 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Enables clickhouse-logger plugin configurations to reference secrets (e.g., credentials) via $ENV://... or $secret://..., allowing credentials to be stored outside of etcd (env vars / Vault) while keeping runtime behavior unchanged.

Changes:

  • Resolve secret references at send time in clickhouse-logger via apisix.secret.fetch_secrets.
  • Add a new integration test covering $ENV://... usage for ClickHouse credentials.
  • Update English and Chinese plugin docs to mention secret/environment-variable support.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
apisix/plugins/clickhouse-logger.lua Fetches and resolves secret references from plugin conf before sending logs to ClickHouse.
t/plugin/clickhouse-logger3.t Adds test coverage for using $ENV://... in ClickHouse logger config.
docs/en/latest/plugins/clickhouse-logger.md Documents that plugin attributes can be sourced from env/secrets.
docs/zh/latest/plugins/clickhouse-logger.md Same documentation update for Chinese docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread t/plugin/clickhouse-logger3.t Outdated
membphis
membphis previously approved these changes Feb 25, 2026
@Baoyuantop
Baoyuantop requested a review from membphis March 12, 2026 07:10

@moonming moonming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @vlad-vinogradov-47, thank you for adding secrets support to clickhouse-logger!

Consistency across logger plugins is important — other loggers already support $secret:// references. With 7 reviews and both tests and documentation included, this looks thorough. I'll review the code in detail shortly.

@moonming
moonming merged commit 4990927 into apache:master Mar 16, 2026
22 checks passed
@vlad-vinogradov-47
vlad-vinogradov-47 deleted the feat-clickhouse-logger-secrets branch March 16, 2026 05:35
wistefan pushed a commit to wistefan/apisix that referenced this pull request Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review plugin size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants