Skip to content

feat(query): Expose metricsStorage to UI as storage capabilities#8154

Merged
yurishkuro merged 6 commits into
jaegertracing:mainfrom
hharshhsaini:feat/inject-metrics-storage-capability
Mar 9, 2026
Merged

feat(query): Expose metricsStorage to UI as storage capabilities#8154
yurishkuro merged 6 commits into
jaegertracing:mainfrom
hharshhsaini:feat/inject-metrics-storage-capability

Conversation

@hharshhsaini

@hharshhsaini hharshhsaini commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

  • Part of #3540 (Step 1 Backend Implementation)
  • The Jaeger UI recently removed the fragile HTTP 501 ping fallback logic (isATMActivated) in favor of trusting the server's JAEGER_STORAGE_CAPABILITIES explicitly. Currently, the UI receives {"archiveStorage": false, "metricsStorage": false} by default from index.html. This PR computes and injects metricsStorage: true/false directly from the query-service into the UI static handler so the frontend understands when metrics storage is actively configured.

Description of the changes

  • Added a MetricsStorage bool field to the StorageCapabilities struct in cmd/jaeger/internal/extension/jaegerquery/querysvc/service.go.
  • Updated cmd/jaeger/internal/extension/jaegerquery/internal/server.go to explicitly set caps.MetricsStorage = true if metricsQuerySvc is not nil during the static UI handler registration.
  • Updated cmd/jaeger/internal/extension/jaegerquery/internal/static_handler_test.go to assert the newly updated JSON serialization format: {"archiveStorage":false,"metricsStorage":false}.

How was this change tested?

  • Tested successfully by running unit tests via make test inside the /cmd/jaeger/internal/extension/jaegerquery/ module.
  • TestRegisterStaticHandler tests were updated and pass, verifying the frontend correctly receives the augmented capabilities struct.

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

Copilot AI review requested due to automatic review settings March 9, 2026 18:26
@hharshhsaini hharshhsaini requested a review from a team as a code owner March 9, 2026 18:26
Signed-off-by: hharshhsaini <sainiharsh3311@gmail.com>
@hharshhsaini hharshhsaini force-pushed the feat/inject-metrics-storage-capability branch from 461f947 to 8d0d371 Compare March 9, 2026 18:28

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

Injects metricsStorage into the JAEGER_STORAGE_CAPABILITIES object served with the Jaeger UI so the frontend can reliably detect whether metrics querying is configured (per #3540 step 1).

Changes:

  • Adds MetricsStorage to the query-service StorageCapabilities struct and JSON output.
  • Sets caps.MetricsStorage during static UI handler registration in the query server router.
  • Updates static handler tests to assert the new JSON serialization shape including metricsStorage.

Reviewed changes

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

File Description
cmd/jaeger/internal/extension/jaegerquery/querysvc/service.go Extends the server-to-UI capability model with metricsStorage.
cmd/jaeger/internal/extension/jaegerquery/internal/server.go Computes and injects the metricsStorage capability into the UI static handler pipeline.
cmd/jaeger/internal/extension/jaegerquery/internal/static_handler_test.go Updates assertions to match the new injected capabilities JSON.

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

Comment thread cmd/jaeger/internal/extension/jaegerquery/querysvc/service.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server.go Outdated
@yurishkuro

Copy link
Copy Markdown
Member

Resolves #3540

Do not say "resolves" if the PR is only part of an issue. Saying "Resolves" causes GH to close the issue once the PR is merged. Say Part of #3540 instead.

@github-actions github-actions Bot added the waiting-for-author PR is waiting for author to respond to maintainer's comments label Mar 9, 2026
Signed-off-by: hharshhsaini <sainiharsh3311@gmail.com>
@github-actions github-actions Bot removed the waiting-for-author PR is waiting for author to respond to maintainer's comments label Mar 9, 2026
@hharshhsaini

Copy link
Copy Markdown
Contributor Author

Resolves #3540

Do not say "resolves" if the PR is only part of an issue. Saying "Resolves" causes GH to close the issue once the PR is merged. Say Part of #3540 instead.

@yurishkuro sorry sir , I will take care of it in future . now I am proceeding with the github sugestions . thank you

Comment thread cmd/jaeger/internal/extension/jaegerquery/querysvc/service.go
Signed-off-by: hharshhsaini <sainiharsh3311@gmail.com>
Copilot AI review requested due to automatic review settings March 9, 2026 18:41

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 4 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server.go Outdated
Signed-off-by: hharshhsaini <sainiharsh3311@gmail.com>
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server.go Outdated
Copilot AI review requested due to automatic review settings March 9, 2026 19:12

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 6 out of 6 changed files in this pull request and generated 5 comments.


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

Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go
Comment thread cmd/jaeger/internal/extension/jaegerquery/server.go Outdated
@hharshhsaini

Copy link
Copy Markdown
Contributor Author

@yurishkuro Copilot AI has left some review suggestions regarding testing the new capability extraction logic and fixing some test cleanups. Since it's an automated review, I wanted to double-check with you , would you like me to implement these suggestions as well, or is the current state good to go

@hharshhsaini hharshhsaini force-pushed the feat/inject-metrics-storage-capability branch from 17751d7 to 79f3daa Compare March 9, 2026 19:28
@yurishkuro

Copy link
Copy Markdown
Member

copilot is correct 95% of the time in my experience. If you think it's not then leave a comment explaining why.

@github-actions github-actions Bot added the waiting-for-author PR is waiting for author to respond to maintainer's comments label Mar 9, 2026
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Copilot AI review requested due to automatic review settings March 9, 2026 20:17
@hharshhsaini hharshhsaini force-pushed the feat/inject-metrics-storage-capability branch from 79f3daa to ce0f291 Compare March 9, 2026 20:17
@github-actions github-actions Bot removed the waiting-for-author PR is waiting for author to respond to maintainer's comments label Mar 9, 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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


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

@hharshhsaini hharshhsaini force-pushed the feat/inject-metrics-storage-capability branch from ce0f291 to b376dc3 Compare March 9, 2026 20:32
Comment thread cmd/jaeger/internal/extension/jaegerquery/internal/server_test.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegerquery/server_test.go Outdated
… caller

Signed-off-by: hharshhsaini <sainiharsh3311@gmail.com>
Copilot AI review requested due to automatic review settings March 9, 2026 21:00
@hharshhsaini hharshhsaini force-pushed the feat/inject-metrics-storage-capability branch from b376dc3 to c7b77ce Compare March 9, 2026 21:00

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 6 out of 6 changed files in this pull request and generated no new comments.


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

@hharshhsaini

Copy link
Copy Markdown
Contributor Author

@yurishkuro I have resolved all the comments and removed the redundant capability tests to keep the diff completely clean. The tests pass perfectly now. I believe the PR is ready for another look whenever you have time. Thanku for the guidance.

@yurishkuro yurishkuro changed the title feat(query): inject metricsStorage into UI capabilities feat(query): Expose metricsStorage to UI as storage capabilities Mar 9, 2026
@yurishkuro yurishkuro merged commit 567de20 into jaegertracing:main Mar 9, 2026
66 checks passed
@codecov

codecov Bot commented Mar 9, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8154      +/-   ##
==========================================
- Coverage   95.67%   95.67%   -0.01%     
==========================================
  Files         317      317              
  Lines       16747    16746       -1     
==========================================
- Hits        16023    16022       -1     
  Misses        571      571              
  Partials      153      153              
Flag Coverage Δ
badger_v1 9.05% <ø> (ø)
badger_v2 1.04% <ø> (ø)
cassandra-4.x-v1-manual 13.25% <ø> (ø)
cassandra-4.x-v2-auto 1.03% <ø> (ø)
cassandra-4.x-v2-manual 1.03% <ø> (ø)
cassandra-5.x-v1-manual 13.25% <ø> (ø)
cassandra-5.x-v2-auto 1.03% <ø> (ø)
cassandra-5.x-v2-manual 1.03% <ø> (ø)
clickhouse 1.16% <ø> (ø)
elasticsearch-6.x-v1 16.60% <ø> (ø)
elasticsearch-7.x-v1 16.63% <ø> (ø)
elasticsearch-8.x-v1 16.78% <ø> (ø)
elasticsearch-8.x-v2 1.04% <ø> (ø)
elasticsearch-9.x-v2 1.04% <ø> (ø)
grpc_v1 7.79% <ø> (ø)
grpc_v2 1.04% <ø> (ø)
kafka-3.x-v2 1.04% <ø> (ø)
memory_v2 1.04% <ø> (ø)
opensearch-1.x-v1 16.67% <ø> (ø)
opensearch-2.x-v1 16.67% <ø> (ø)
opensearch-2.x-v2 1.04% <ø> (ø)
opensearch-3.x-v2 1.04% <ø> (ø)
query 1.04% <ø> (ø)
tailsampling-processor 0.52% <ø> (ø)
unittests 94.36% <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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants