serverinfo icon indicating copy to clipboard operation
serverinfo copied to clipboard

Add exporter for prometheus

Open krombel opened this issue 5 years ago • 11 comments

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.

krombel avatar Jan 11 '19 18:01 krombel

A Nextcloud exporter for Prometheus already exists here https://github.com/xperimental/nextcloud-exporter

j-ed avatar Feb 22 '19 14:02 j-ed

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)

krombel avatar Feb 25 '19 01:02 krombel

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.

j-ed avatar Feb 25 '19 07:02 j-ed

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.

sebastiansterk avatar Feb 14 '20 23:02 sebastiansterk

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?

jmthackett avatar Apr 24 '20 15:04 jmthackett

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.

0x7081 avatar Apr 27 '20 22:04 0x7081

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

J0WI avatar May 10 '20 13:05 J0WI

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

colttt avatar Jan 20 '21 09:01 colttt

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.

isdnfan avatar Nov 18 '21 21:11 isdnfan

the PR for the token is here: https://github.com/nextcloud/serverinfo/pull/269

PVince81 avatar Nov 19 '21 07:11 PVince81