<div dir="ltr"><div>Hello,</div><div><br></div><div>Following the discussions here: <a href="https://github.com/hawkular/hawkular-metrics/pull/584">https://github.com/hawkular/hawkular-metrics/pull/584</a> I would like to bring that up:</div><div><br></div><div>---------<br></div><div>The problem<br></div><div>I came to some limitation of the current REST API of hawkular-metrics when adding features to the Grafana plugin. The main point here is that because of an issue in Grafana (and/or golang) which you&#39;ve certainly already discussed before I join, we&#39;re limited in the use of @get endpoints when metric ids are sent as query parameters. Although it has already been solved in the current version of the grafana plugin, the problem reappears when I&#39;m trying to add features.</div><div><br></div><div>But beside those grafana centric considerations I think that it could be a good occasion to bring more consistency to the REST API when querying data for multiple metrics. There&#39;s several endpoints that, in my opinion, could be harmonized.</div><div><br></div><div>-----</div><div>So what&#39;s missing?</div><div><br></div><div>(note, by &quot;*&quot; I mean &quot;gauges&quot;, &quot;counters&quot;, &quot;availability&quot; or &quot;string&quot; ; not &quot;metrics&quot;. When I write &quot;/raw&quot;, same applies for &quot;/rate&quot;.)<br></div><div><br></div><div>- Some endpoints like &quot;@get */stats&quot; allow to query by list of ids or list of tags, but there&#39;s no equivalent on &quot;@get */raw&quot;, and the &quot;@post */raw/query&quot; doesn&#39;t handle tags</div><div>Note that I&#39;ve already opened a JIRA ticket for query-by-tag generalization: <a href="https://issues.jboss.org/browse/HWKMETRICS-466">https://issues.jboss.org/browse/HWKMETRICS-466</a> . I can&#39;t find any good reason why we could do it when querying stats, but not when querying raw data.</div><div><br></div><div>- On the other hand, endpoints like &quot;@post */raw/query&quot;, used for grafana, has no equivalent for &quot;stats&quot;. I would really like to have this one for Grafana.</div><div><br></div><div>- List of metrics sometimes referred as &quot;ids&quot; (class QueryRequest), sometimes &quot;metrics&quot; (all @get query params). We could add &quot;metrics&quot; in QueryRequest but keep/deprecate &quot;ids&quot; for compatibility?</div><div><br></div><div>-----</div><div>Suggestions:</div><div><br></div><div>1st Option: keep the API in the current form and bring all endpoints up to the same level of functionality, that is:</div><div>  * Create &quot;@get */raw&quot; that can take ids or tags</div><div>  * Make &quot;@post */raw/query&quot; understand tags</div><div>  * Create &quot;@post */stats/query&quot; that can take ids or tags</div><div><br></div><div>---</div><div>2d Option: change the current model to dissociate query by ids or by tags</div><div>Basically the idea is to provide different path if we want to query by ids or by tags, to avoid having the assertion we currently have &quot;must provide either ids or tags but not both&quot;. I think it&#39;s cleaner to separate them. Of course it has the downside of breaking (making deprecated) all query-by-tag in the current API.</div><div><br></div><div>So, queries by ids would be the default one:</div><div>  * &quot;@get */raw&quot;</div><div>  * &quot;@get */stats&quot;</div><div>  * &quot;@post */raw/query&quot;</div><div>  * &quot;@post */stats/query&quot;</div><div>None of them would accept tags</div><div><br></div><div>And query by tag would be:</div><div>  * &quot;@get */raw/tags&quot; (or &quot;*/raw/tags/{tags}&quot; ?)</div><div>  * &quot;@get */stats/tags&quot;</div><div>  * &quot;@post */raw/tags/query&quot;</div><div>  * &quot;@post */stats/tags/query&quot;</div><div>None of them would accept ids</div><div><br></div><div>---</div><div>Other Option?</div><div><br></div><div><br></div><div>=&gt; Personally, given the downside of the 2/ I would rather go for the 1st one.</div></div>