Skip to content

[Studio] Test Prometheus data source connections - #517

Closed
Aias00 wants to merge 1 commit into
apache:rocketmq-studiofrom
Aias00:fix/studio-prometheus-datasource-test
Closed

[Studio] Test Prometheus data source connections#517
Aias00 wants to merge 1 commit into
apache:rocketmq-studiofrom
Aias00:fix/studio-prometheus-datasource-test

Conversation

@Aias00

@Aias00 Aias00 commented Jul 24, 2026

Copy link
Copy Markdown

Motivation

This is a small follow-up for #431. The Settings data source test endpoint still returned a fixed success response, so users could not validate whether a configured Prometheus-compatible source was actually reachable.

Changes

  • Replace the fixed success response in SettingsService.testDataSource with a real Prometheus-compatible HTTP API probe.
  • Query /api/v1/query?query=up for Prometheus, VictoriaMetrics, Thanos, and Mimir style data sources.
  • Return explicit failure messages for invalid URLs, upstream Prometheus errors, connection failures, and timeouts.
  • Avoid logging the full data source URL during connection tests.
  • Add regression tests with a local mock HTTP server.

Non-goals

This PR does not add credential fields or replace dashboard charts. It only makes the existing test endpoint validate the configured Prometheus-compatible URL.

Verification

  • JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home mvn -B -ntp -Dtest=SettingsServiceTest test
  • JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home mvn -B -ntp test

Copilot AI review requested due to automatic review settings July 24, 2026 05:10

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Aias00
Aias00 force-pushed the fix/studio-prometheus-datasource-test branch from 5fd5000 to 9f89266 Compare July 24, 2026 07:14
@Aias00

Aias00 commented Jul 27, 2026

Copy link
Copy Markdown
Author

Superseded by #637. Consolidated with related Metrics/Prometheus validation changes to reduce review overhead while preserving the same scoped fixes and tests.

@Aias00 Aias00 closed this Jul 27, 2026
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.

2 participants