janhoy opened a new pull request, #3908:
URL: https://github.com/apache/solr/pull/3908
Claude an I made this PR to let (old) Admin UI continue to parse metrics,
even from the new prometheus format.
The PR consists of a frontend and a backend part.
**Frontend**:
* A new `prometheus-parser.js` which parses prometheus text into JS objects,
exposed as an angularjs service `PrometheusParser`
* A new `metrics-extractor.js` helper that helps the UI extract different
metrics from the parsed metrics
* `cloud.js` behaves as before, preparing a nodes list and a list of metric
names to filer instead of a list of prefixes
**Backend**:
* `AdminHandlersProxy` and `PrometheusResponseWriter` modified
* Proxy fans out to listed nodes (or `all`), getting prometheus lines in
text format, reading 8 nodes in parallel
* Proxy adds a new label to all metric lines `node=<node-name>`
* `PrometheusResponseWriter` adapted to write the merged response
Luckily the prometheus line-based format lends itself to just concatenating
the metrics from all nodes requested (after adding a node label). The frontend,
after parsing all lines, can then pick out metrics for each node by filtering
on the label.
I considered going the `CORS` direction, but stuck with the proxy approach
since Solr often is deployed behind reverse proxy, Kubernetes ingress etc,
where the host-name and path that Admin-UI sees is different from zookeeper,
and it would not only be added configuration to map the various host/url
mappings, but we could not either now that various deploys actually expose
every single solr node on its own external URL. Besides we'd have to handle not
only CORS but also auth and ssl.
https://issues.apache.org/jira/browse/SOLR-18004
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]