asafm commented on PR #4164:
URL: https://github.com/apache/bookkeeper/pull/4164#issuecomment-1873779527
@hangc0276 `/metrics` should be Prometheus compatible.
If you look at the Prometheus Java client, setting up a server, exposing
`/metrics` you'll see it only supports specifying the metric names, using the
query param `name[]`.
```
protected static Set<String> parseQuery(String query) throws IOException
{
Set<String> names = new HashSet<String>();
if (query != null) {
String[] pairs = query.split("&");
for (String pair : pairs) {
int idx = pair.indexOf("=");
if (idx != -1 && URLDecoder.decode(pair.substring(0, idx),
"UTF-8").equals("name[]")) {
names.add(URLDecoder.decode(pair.substring(idx + 1),
"UTF-8"));
}
}
}
return names;
}
```
Besides that, I presume the idea is that BookKeeper users will transition
into OpenTelemetry which is already available. For now, even OpenTelemetry Java
SDK doesn't support filtering YET.
I added a
[proposal](https://github.com/open-telemetry/opentelemetry-specification/pull/3566)
to OTel specifications and it was approved, and hopefully in the following
months it will be implemented.
For now I recommend not adding it, and using OTel collector to scrape
`/metrics` and filter out any unwanted metrics.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]