Skip to content

fix(opamp): authenticate PromQL remote write to ClickHouse - #3909

Draft
NginxL wants to merge 1 commit into
ClickHouse:mainfrom
NginxL:fix/h2b33-3906-promql-remote-write-auth
Draft

NginxL wants to merge 1 commit into
ClickHouse:mainfrom
NginxL:fix/h2b33-3906-promql-remote-write-auth

Conversation

@NginxL

@NginxL NginxL commented Dec 5, 2026

Copy link
Copy Markdown

Summary

Adds ClickHouse authentication headers to the PromQL prometheusremotewrite exporter in both configuration paths:

  • OpAMP-managed collector configuration.
  • Standalone PromQL collector YAML.

The exporter now sends X-ClickHouse-User and X-ClickHouse-Key from CLICKHOUSE_USER / CLICKHOUSE_PASSWORD, matching the credentials already used by the ClickHouse exporters. This allows remote write to work when the ClickHouse default user has a password instead of repeatedly failing with authentication error 194.

The OpAMP controller test now asserts both headers. No UI code is changed.

Screenshots or video

N/A — non-UI configuration change.

How to reproduce

Starting point: A Helm/standalone ClickStack deployment with PromQL enabled and a password configured for the ClickHouse user, as described in #3906.

On main:

  1. Send OTLP metrics to the collector.
  2. Observe repeated Prometheus remote-write authentication failures and an empty metrics_ts / PromQL source.

On this branch:

  1. Apply the updated collector configuration with the same CLICKHOUSE_USER and CLICKHOUSE_PASSWORD environment variables used by the ClickHouse exporter.
  2. Send OTLP metrics.
  3. Verify remote writes authenticate and metrics become queryable through PromQL.

A live ClickHouse/collector deployment was not available in this environment, so these runtime steps remain for CI or reviewer validation.

How to test on Vercel preview

Preview routes: N/A — non-UI change.

Steps: N/A.

References

Validation and gaps

  • Parsed config.standalone.promql.yaml with Ruby Psych and verified both header values.
  • Extended the existing OpAMP exporter test with the expected headers.
  • git diff --check passed for all three files.
  • The Jest suite was not run: local dependencies are absent and new package downloads were prohibited. TypeScript compilation, collector acceptance tests, and a live password-protected ClickHouse remote-write check remain for CI/review.

AI disclosure: This patch and PR description were prepared with AI assistance and checked against the linked reproduction and current exporter configuration. The commit includes a DCO Signed-off-by trailer.

Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Dec 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c955fd7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Dec 5, 2026

Copy link
Copy Markdown

@NginxL is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant