[opensuse] Prometheus woes
OK, another silly question. Does anybody use prometheus? I just installed it but I'm not having much luck getting started with it. I installed it fromthe Leap 15.0 repositories. It runs and --version tells me: prometheus, version 2.1.0 (branch: non-git, revision: non-git) build user: abuild@lamb69 build date: 20180513-03:46:03 go version: go1.9.4 so at least it runs. I can't find any opensuse docs to tell me about anything specific (no man page in particular) so I'm relying on the 'Starting' section in https://prometheus.io/docs/introduction/first_steps/ which is not brilliant. I first tried running as my own user and failed with lack of permission to create /var/lib/prometheus/metrics so then I tried as root, which seemed to work but seems a bit weird, so then I tried user prometheus and that worked too, so is probably right, but it would be nice if there was opensuse docs to say so, and/or something on the web page to indicate it. Anyway, I then fired up a browser and pointed it at http://localhost:9090/graph and got a display. But it doesn't seem to work like https://prometheus.io/docs/introduction/first_steps/ says it should. I assume it means 'choose the "Console" view alongside the "Graph" tab' as opposed to what it does say. But it just says 'no data'. I assume that 'the expression console' is the text box at the top of the screen but nothing happens when I put the recommended string into it, and if I hit Execute, it says 'No datapoints found' Prometheus appears to log to the console where it was started, but apart from some messages saying it has started, there's nothing to indicate any problems. In /var/lib/prometheus/metrics/wal I have two files, one is 434K and the other is 256M so it's certainly storing something! What it is if not datapoints is beyond me. So anybody know what's going on? Or can point me to some better/more accurate documentation? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi! Am Montag, 7. Januar 2019, 18:25:50 CET schrieb Dave Howorth:
OK, another silly question. Does anybody use prometheus?
Yes. However in "production" I use the upstream build as the SUSE package sadly is not available vor ARMv7. (Yes, I run it on a Raspberry PI 2.) To look at your issue I installed it on my workstation.
I just installed it but I'm not having much luck getting started with it.
I assume you did `zypper in golang-github-prometheus-prometheus` .
prometheus, version 2.1.0 (branch: non-git, revision: non-git) build user: abuild@lamb69 build date: 20180513-03:46:03 go version: go1.9.4
Yep, can reproduce.
so at least it runs. I can't find any opensuse docs to tell me about anything specific (no man page in particular) so I'm relying on the 'Starting' section in https://prometheus.io/docs/introduction/first_steps/ which is not brilliant. I first tried running as my own user and failed with lack of permission to create /var/lib/prometheus/metrics so then I tried as root, which seemed to work but seems a bit weird, so then I tried user prometheus and that worked too, so is probably right, but it would be nice if there was opensuse docs to say so, and/or something on the web page to indicate it.
There is nothing special about the SUSE package. When running as a user you will have to give it a configuration file so that it will find a proper place to store its data and know what to scrape. I suggest to run it via the Systemd unit contained in the package: systemctl start prometheus.service This will run the service as the Prometheus service which will have write access to /var/lib/prometheus/metrics. It will use the config file from the default location at /etc/prometheus/ prometheus.yml. The package provides a working basic configuration.
Anyway, I then fired up a browser and pointed it at http://localhost:9090/graph and got a display. But it doesn't seem to work like https://prometheus.io/docs/introduction/first_steps/ says it should. I assume it means 'choose the "Console" view alongside the "Graph" tab' as opposed to what it does say. But it just says 'no data'. I assume that 'the expression console' is the text box at the top of the screen but nothing happens when I put the recommended string into it, and if I hit Execute, it says 'No datapoints found'
It sometimes takes a couple seconds until Prometheus has the first data collection (it usually samples every 60s). On the Graph view you will see a dropdown with all available metrics next to the execute button. Selecting one there will insert it into the query editor. Pressing execute should give you data. This works for me with the freshly installed package and started Systemd unit. The IMHO most helpful debugging screen of Prometheus is http://localhost:9090/ targets. This will show you wether anything has been configured to be scraped, when it was last scraped, and wether it was up. In addition, http://localhost: 9090/config will give you the current configuration, allowing you to verify that Prometheus is actually using the config file you expect it to use. The version in Leap is not the latest one, but should be recent enough not to differ from the upstream documentation too much. I hope this could help you somewhat. Kind Regards, Matthias -- Dr. Matthias Bach www.marix.org „Der einzige Weg, die Grenzen des Möglichen zu finden, ist ein klein wenig über diese hinaus in das Unmögliche vorzustoßen.“ - Arthur C. Clarke
On Fri, 11 Jan 2019 22:07:15 +0100 Matthias Bach <marix@marix.org> wrote:
Hi!
Am Montag, 7. Januar 2019, 18:25:50 CET schrieb Dave Howorth:
OK, another silly question. Does anybody use prometheus?
Yes. However in "production" I use the upstream build as the SUSE package sadly is not available vor ARMv7. (Yes, I run it on a Raspberry PI 2.)
To look at your issue I installed it on my workstation.
I just installed it but I'm not having much luck getting started with it.
I assume you did `zypper in golang-github-prometheus-prometheus` .
prometheus, version 2.1.0 (branch: non-git, revision: non-git) build user: abuild@lamb69 build date: 20180513-03:46:03 go version: go1.9.4
Yep, can reproduce.
so at least it runs. I can't find any opensuse docs to tell me about anything specific (no man page in particular) so I'm relying on the 'Starting' section in https://prometheus.io/docs/introduction/first_steps/ which is not brilliant. I first tried running as my own user and failed with lack of permission to create /var/lib/prometheus/metrics so then I tried as root, which seemed to work but seems a bit weird, so then I tried user prometheus and that worked too, so is probably right, but it would be nice if there was opensuse docs to say so, and/or something on the web page to indicate it.
There is nothing special about the SUSE package. When running as a user you will have to give it a configuration file so that it will find a proper place to store its data and know what to scrape.
I suggest to run it via the Systemd unit contained in the package:
systemctl start prometheus.service
This will run the service as the Prometheus service which will have write access to /var/lib/prometheus/metrics.
It will use the config file from the default location at /etc/prometheus/ prometheus.yml. The package provides a working basic configuration.
Anyway, I then fired up a browser and pointed it at http://localhost:9090/graph and got a display. But it doesn't seem to work like https://prometheus.io/docs/introduction/first_steps/ says it should. I assume it means 'choose the "Console" view alongside the "Graph" tab' as opposed to what it does say. But it just says 'no data'. I assume that 'the expression console' is the text box at the top of the screen but nothing happens when I put the recommended string into it, and if I hit Execute, it says 'No datapoints found'
It sometimes takes a couple seconds until Prometheus has the first data collection (it usually samples every 60s). On the Graph view you will see a dropdown with all available metrics next to the execute button. Selecting one there will insert it into the query editor. Pressing execute should give you data. This works for me with the freshly installed package and started Systemd unit.
The IMHO most helpful debugging screen of Prometheus is http://localhost:9090/ targets. This will show you wether anything has been configured to be scraped, when it was last scraped, and wether it was up. In addition, http://localhost: 9090/config will give you the current configuration, allowing you to verify that Prometheus is actually using the config file you expect it to use.
The version in Leap is not the latest one, but should be recent enough not to differ from the upstream documentation too much. I hope this could help you somewhat.
Kind Regards, Matthias
Thanks Matthias. I gave up and deleted the package, but if I look again I'll make use of your helpful notes. Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Dave Howorth
-
Matthias Bach