Skip to content

Metrics query support - #1189

Open
thomascorthals wants to merge 4 commits into
solariumphp:masterfrom
thomascorthals:metrics
Open

thomascorthals wants to merge 4 commits into
solariumphp:masterfrom
thomascorthals:metrics

Conversation

@thomascorthals

Copy link
Copy Markdown
Member

Closes #669.

I've modelled this on Solr 10 which overhauled the query parameters for Metrics queries. It also did away with the JSON response format and introduced OpenMetrics 1.0 alongside the now default Prometheus format. To parse this response into an object, I've suggested butschster/prometheus-parser. Without this library, it's still possible to get the raw output as shown in the examples.

For older Solr versions, you can explicitly set WT_JSON on the query and get the ouput as an array, but not as Result object. This is also shown in the examples.

As a side quest, I've added Utility::stringOrArrayToArray() because I found myself repeating the same code for methods that take 'one, two' or ['one', 'two'] as equivalent ways of passing the same options.

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.40%. Comparing base (1acb7db) to head (fdfe81d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1189      +/-   ##
==========================================
- Coverage   98.42%   98.40%   -0.02%     
==========================================
  Files         403      406       +3     
  Lines       10659    10676      +17     
==========================================
+ Hits        10491    10506      +15     
- Misses        168      170       +2     
Flag Coverage Δ
unittests 98.40% <100.00%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

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.

Metrics API

1 participant