#855145 prometheus: Console templates don't work out of the box

Package:
prometheus
Source:
prometheus
Description:
monitoring system and time series database
Submitter:
Tim Small
Date:
2024-09-23 02:33:01 UTC
Severity:
normal
#855145#5
Date:
2017-02-14 16:42:43 UTC
From:
To:
The sample consoles are missing when the debian package is installed,
giving users a system with reduced functionality and usability.  Nothing
in the UI gives any indication that they are missing, or that they must
be manually restored (or how).

Furthermore some prometheus tutorials refer to the example consoles.

For example:

http://localhost:9090/consoles/node.html

These fail to work out of the box with the Debian packages, and give a
relatively hard to diagnose error message.  The
/etc/prometheus/consoles/README.consoles file gives some info, but
simply copying the contents of
/usr/share/doc/prometheus/examples/consoles/ into
/etc/prometheus/consoles/ is both messy, and also doesn't work due to
missing template libraries.

# cp -a /usr/share/doc/prometheus/examples/consoles/*
/etc/prometheus/consoles/
# cp -a /usr/share/doc/prometheus/examples/console_libraries/*
/etc/prometheus/console_libraries/
# gzip -d /etc/prometheus/console_libraries/*.gz

I can understand not wanting to ship a load of code into /etc/ but
surely it would be better if they worked out of the box from /usr/share,
whilst still allowing addition (perhaps this could be done by just
installing an index.html under /etc/ or modifying the code to try to
serve files from /etc/consoles/ and falling back to
/usr/shared/doc/prometheus/examples/consoles/ if they don't exist?).

#855145#10
Date:
2017-03-02 06:43:39 UTC
From:
To:
Hi Tim,

It is a tricky situation. As I have chosen to place the templates in
/etc, if I actually install templates by default, they become conffiles,
and upgrades will be problematic. Looking back, that was maybe a mistake.

In any case, the sample templates are buggy and really not too useful. I
think upstream is not very fond of them.

Yes, it was a mistake placing the sample templates in documentation
directories (that's why they are compressed). But once you do this, the
templates actually work, don't they?

That can be problematic too, as you not necesarily want the default
templates present at all, or they might be completely broken because you
are not following the same conventions as those templates.

I think a reasonable way forward would be to move the templates out of
/etc, and place some bare-bones templates that will provide some basic
functionality for the node-exporter, and nothing else. That requires
first to fix many bugs in the sample templates.

If you have the chance to make some of these improvements, I'd be happy
to include them in the package.

Thanks for your report.

#855145#15
Date:
2022-06-23 00:01:51 UTC
From:
To:
Attached is at least one patch needed to make the sample consoles usable.
#855145#20
Date:
2022-12-19 05:42:35 UTC
From:
To:
On Wed, 22 Jun 2022 17:01:51 -0700 Rob Leslie <rob@mars.org> wrote:
 > Attached is at least one patch needed to make the sample consoles usable.

Unfortunately it requires a slightly more extensive patch than that. See
https://salsa.debian.org/go-team/packages/prometheus/-/commit/d95f2bf1764710e4583be69340f4c1502361b57a

#855145#25
Date:
2024-09-23 02:29:57 UTC
From:
To:
The sample console templates have been removed from the upstream
release-3.0 branch:

https://github.com/prometheus/prometheus/pull/14807

It might be a while before we can package Prometheus 3.0 in Debian,
because even the latest Prometheus 2.x version has a sprawling
dependency tree. But I have no interest in maintaining an ever-growing
patchset delta in the Debian package. So if upstream removes it, so will
the Debian package.

I honestly think that for a lot of custom console use cases, Grafana
could probably fulfill the requirements.