serverinfo
serverinfo copied to clipboard
Add exporter for prometheus
There is an interface which can be used for an external monitoring tool.
I don't know which tool is that format meant to support but I know that it is not compatible to prometheus. I would like to have a prometheus-compatible export.
A Nextcloud exporter for Prometheus already exists here https://github.com/xperimental/nextcloud-exporter
That is an interesting and useful tool! Thanks for mentioning it. But this tool is just an workaround.
This issues is about to add an export URL to this app which I can point prometheus directly at to generate such metrics (does not have to be /metrics
which seems to be common)
It's the normal way that an API provides a standard way and output to access data, instead of creating an undefined number of customizations for applications which are not part of the original software. Due to the fact that this exporter exists, which wraps the Nextcloud API output, I would assume that the Nextcloud team won't spend time on this.
Since Prometheus is a very common tool, it would be great if nextcloud could provide a metric endpoint by default. Furthermore, the above mentioned 3rd party exporter looks like it is no longer maintained.
It'd be nice at least if there was a sensible way to use the above tool without giving it admin rights. In lieu of that, could this be exposed through an app?
It'd be nice at least if there was a sensible way to use the above tool without giving it admin rights. In lieu of that, could this be exposed through an app?
I wrote my own tool to get the data. As far as I know there is no other way to get the data of the API without creating an admin user.
I packed my exporter in a Docker container and hand over the credentials via Environment Variables.
As far as I know there is no other way to get the data of the API without creating an admin user.
See workaround in https://github.com/nextcloud/serverinfo/issues/100#issuecomment-412333522
I think it can be closed. If NC adds an exporter for prometheus, then user from Zabbix, PRTG, OpenNMS, Icinga, etc also want their thing. NC has a good serverinfo-output, it can be used with xml and json. A good monitoring solution must handle that. But it would be nice if NC add #100
It'd be nice at least if there was a sensible way to use the above tool without giving it admin rights. In lieu of that, could this be exposed through an app?
with 22.2.3 there is an option to create a "token" which act as secret (HTTP header) to access the serverinfo data without additional user. didn't found any PR when this really cool feature was added:
To use an access token please generate one then set it using the following command: occ config:app:set serverinfo token --value yourtoken Then pass the token with the "NC-Token" header when querying the above URL.
the PR for the token is here: https://github.com/nextcloud/serverinfo/pull/269
the above mentioned 3rd party exporter looks like it is no longer maintained.
The previously mentioned Prometheus exporter from @xperimental appears actively maintained today (and going back the past couple years):
- https://github.com/xperimental/nextcloud-exporter
In any case, a possible direction to explore - if anything - might be OpenMetrics which would presumably not be limited to Prometheus (though I think it's backed by them):
- Support for exporting FPM metrics (only) via OpenMetrics was recently added in PHP 8.1.
- There looks to be at least one PHP library project trying to enable PHP based projects to add it to their software called OpenMetrics-PHP. Though it's status is unclear. I also did not look to deeply to see if there are any others.
Given all the interest expressed here (in the votes) I'd have expected a PR attempt or two, but I don't see any. Not sure what that means - simply sharing a data point.