Skip to content

[metricstore] Remove min step API from metricstore#8425

Merged
mahadzaryab1 merged 5 commits into
jaegertracing:mainfrom
mahadzaryab1:remove-getminstepduration
Apr 23, 2026
Merged

[metricstore] Remove min step API from metricstore#8425
mahadzaryab1 merged 5 commits into
jaegertracing:mainfrom
mahadzaryab1:remove-getminstepduration

Conversation

@mahadzaryab1

Copy link
Copy Markdown
Collaborator

Which problem is this PR solving?

Description of the changes

  • Removes the GetMinStepDuration function and all its implementations as it is not used by the UI today.

How was this change tested?

  • CI

Checklist

AI Usage in this PR (choose one)

See AI Usage Policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Copilot AI review requested due to automatic review settings April 23, 2026 01:40
@mahadzaryab1 mahadzaryab1 added the changelog:breaking-change Change that is breaking public APIs or established behavior label Apr 23, 2026
@mahadzaryab1 mahadzaryab1 requested a review from a team as a code owner April 23, 2026 01:40
@dosubot dosubot Bot added the area/storage label Apr 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes the GetMinStepDuration metricstore API surface and its backend implementations, since it’s no longer used by the UI.

Changes:

  • Dropped GetMinStepDuration from metricstore.Reader and removed MinStepDurationQueryParameters.
  • Removed GetMinStepDuration implementations/tests from ClickHouse v2, Prometheus, Elasticsearch, and disabled metricstores.
  • Removed metrics instrumentation and related mocks for GetMinStepDuration.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/storage/v1/api/metricstore/interface.go Removes GetMinStepDuration from the Reader interface and deletes its query params type.
internal/storage/v1/api/metricstore/mocks/mocks.go Updates generated mocks to match the new Reader interface (drops min-step method).
internal/storage/v1/api/metricstore/metricstoremetrics/decorator.go Removes decorator instrumentation for the min-step operation.
internal/storage/v1/api/metricstore/metricstoremetrics/decorator_test.go Adjusts tests for decorator behavior (but still needs updates to expected counters).
internal/storage/v2/clickhouse/metricstore/reader.go Removes ClickHouse v2 stub implementation for GetMinStepDuration.
internal/storage/v2/clickhouse/metricstore/reader_test.go Removes ClickHouse v2 tests for GetMinStepDuration.
internal/storage/metricstore/prometheus/metricstore/reader.go Removes Prometheus min-step constant and method implementation.
internal/storage/metricstore/prometheus/metricstore/reader_test.go Removes Prometheus GetMinStepDuration test.
internal/storage/metricstore/elasticsearch/reader.go Removes Elasticsearch min-step constant and method implementation.
internal/storage/metricstore/elasticsearch/reader_test.go Removes Elasticsearch GetMinStepDuration test.
internal/storage/metricstore/disabled/reader.go Removes disabled-reader GetMinStepDuration implementation.
internal/storage/metricstore/disabled/reader_test.go Removes disabled-reader GetMinStepDuration test.
cmd/jaeger/internal/extension/jaegerquery/internal/http_handler.go Removes the min-step handler implementation (but route registration still references it).
cmd/jaeger/internal/extension/jaegerquery/internal/http_handler_test.go Removes min-step endpoint test (but another test still calls /api/metrics/minstep).

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

Comment on lines 382 to 384
func (aH *APIHandler) metrics(w http.ResponseWriter, r *http.Request, getMetrics func(context.Context, metricstore.BaseQueryParameters) (*metrics.MetricFamily, error)) {
requestParams, err := aH.queryParser.parseMetricsQueryParams(r)
if aH.handleError(w, err, http.StatusBadRequest) {

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

minStep handler was removed, but RegisterRoutes still registers /metrics/minstep via aH.minStep, which will not compile. Remove the route registration (and any related endpoint expectations) to fully drop the API, or reintroduce the handler if the endpoint should remain supported.

Copilot uses AI. Check for mistakes.
Comment on lines 1030 to 1032
// getJSON fetches a JSON document from a server via HTTP GET
func getJSON(url string, out any) error {
return getJSONCustomHeaders(url, make(map[string]string), out)

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

TestMetricsQueryDisabled still calls /api/metrics/minstep and expects the "metrics querying is currently disabled" error. Since the minstep endpoint is being removed, this test case should be deleted or updated to assert the new expected behavior (e.g., 404 / route not found) after the route is removed.

Copilot uses AI. Check for mistakes.
Comment on lines 41 to 43
counters, gauges := mf.Snapshot()
wantCounts := map[string]int64{
"requests|operation=get_latencies|result=ok": 1,

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The expected counters in wantCounts still include operation=get_min_step_duration, but GetMinStepDuration instrumentation was removed from the decorator. Update the expected counter maps in this test (and the failing-calls variant below) to remove get_min_step_duration entries.

Copilot uses AI. Check for mistakes.
Comment on lines 109 to 111
counters, gauges := mf.Snapshot()
wantCounts := map[string]int64{
"requests|operation=get_latencies|result=ok": 0,

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This test’s wantCounts map still expects operation=get_min_step_duration counters, but the decorator no longer emits them after removing GetMinStepDuration. Remove those expected entries so the assertions reflect the updated decorator.

Copilot uses AI. Check for mistakes.
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.09%. Comparing base (f9333aa) to head (7c7e0d5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8425      +/-   ##
==========================================
- Coverage   96.10%   96.09%   -0.01%     
==========================================
  Files         323      323              
  Lines       20643    20619      -24     
==========================================
- Hits        19838    19814      -24     
  Misses        649      649              
  Partials      156      156              
Flag Coverage Δ
badger_direct 9.22% <0.00%> (+<0.01%) ⬆️
badger_e2e 0.99% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-direct-manual 12.57% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-e2e-auto 0.98% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-e2e-manual 0.98% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-direct-manual 12.57% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-e2e-auto 0.98% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-e2e-manual 0.98% <0.00%> (+<0.01%) ⬆️
clickhouse-direct 8.47% <0.00%> (+<0.01%) ⬆️
clickhouse-e2e 1.12% <0.00%> (+<0.01%) ⬆️
elasticsearch-6.x-direct 16.86% <0.00%> (+0.01%) ⬆️
elasticsearch-7.x-direct 16.91% <0.00%> (+0.01%) ⬆️
elasticsearch-8.x-direct 17.06% <0.00%> (+0.01%) ⬆️
elasticsearch-8.x-e2e 0.99% <0.00%> (+<0.01%) ⬆️
elasticsearch-9.x-e2e 0.99% <0.00%> (+<0.01%) ⬆️
grpc_direct 7.56% <0.00%> (+<0.01%) ⬆️
grpc_e2e 0.99% <0.00%> (+<0.01%) ⬆️
kafka-3.x-v2 0.99% <0.00%> (-0.09%) ⬇️
memory_v2 0.99% <0.00%> (+<0.01%) ⬆️
opensearch-1.x-direct 16.95% <0.00%> (+0.01%) ⬆️
opensearch-2.x-direct 16.95% <0.00%> (+0.01%) ⬆️
opensearch-2.x-e2e 0.99% <0.00%> (+<0.01%) ⬆️
opensearch-3.x-e2e 0.99% <0.00%> (+<0.01%) ⬆️
query 0.99% <0.00%> (+<0.01%) ⬆️
tailsampling-processor 0.47% <0.00%> (+<0.01%) ⬆️
unittests 94.54% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Copilot AI review requested due to automatic review settings April 23, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


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

@@ -41,11 +40,10 @@ func (q *queryMetrics) emit(err error, latency time.Duration) {
// NewReadMetricsDecorator returns a new ReadMetricsDecorator.

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The doc comment says NewReadMetricsDecorator but the function is named NewReaderDecorator. Please update the comment to match the actual function name (or rename the function) so GoDoc and search results are accurate.

Suggested change
// NewReadMetricsDecorator returns a new ReadMetricsDecorator.
// NewReaderDecorator returns a new ReadMetricsDecorator.

Copilot uses AI. Check for mistakes.
Comment on lines 119 to 122
aH.handleFunc(router, aH.latencies, http.MethodGet, "/metrics/latencies")
aH.handleFunc(router, aH.calls, http.MethodGet, "/metrics/calls")
aH.handleFunc(router, aH.errors, http.MethodGet, "/metrics/errors")
aH.handleFunc(router, aH.minStep, http.MethodGet, "/metrics/minstep")
aH.handleFunc(router, aH.getQualityMetrics, http.MethodGet, "/quality-metrics")

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This PR removes the /api/metrics/minstep endpoint, but docker-compose/monitor/README.md still documents and demonstrates it. Please update/remove that documentation (or add a note about removal) to avoid broken examples for users.

Copilot uses AI. Check for mistakes.

@yurishkuro yurishkuro 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.

we also need to remove it from IDL

@mahadzaryab1 mahadzaryab1 added this pull request to the merge queue Apr 23, 2026
Merged via the queue into jaegertracing:main with commit 5b8081c Apr 23, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage changelog:breaking-change Change that is breaking public APIs or established behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants