opensearch-project / opensearch-project/sql
[BUG] Prometheus query API does not support scalar
Open
@lezzago is already working on this.
Since Mar 24, 2026.
bug
prometheus
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
What is the bug?
Prometheus query API does not support scalar result type
How can one reproduce the bug?
Steps to reproduce the behavior:
- add prometheus data source
- run query
❯ curl -X 'POST' -H 'Content-Type:application/json' --data-binary '{
"query": "scalar(count(up))",
"language": "PROMQL",
"options": {
"queryType": "instant",
"time": "1773874502"
}
}' --insecure -A 'kulala.nvim/5.3.4' 'localhost:9200/_plugins/_directquery/_query/my_prometheus'
{
"status": 500,
"error": {
"type": "MismatchedInputException",
"reason": "There was internal problem at backend",
"details": "Cannot construct instance of `org.opensearch.sql.directquery.transport.model.datasource.PrometheusResult$PrometheusResultItem` (although at least one Creator exists): no int/Int-argument constructor/factory method to deserialize from Number value (1773874502)\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 32] (through reference chain: org.opensearch.sql.directquery.transport.model.datasource.PrometheusResult[\"result\"]-\u003ejava.util.ArrayList[0])"
}
}%
What is the expected behavior?
should not have 500 error
What is your host/environment?
- OS: [e.g. iOS]
- Version [e.g. 22] 87067f11dd984cf64dbcecf0921b8ad15bac44e4
- Plugins
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.