-
Notifications
You must be signed in to change notification settings - Fork 189
[BUG] Prometheus query API does not support scalar #5251
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
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] 87067f1
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working