[pkg-go] Bug#855145: Bug#855145: prometheus: Console templates don't work out of the box

Martín Ferrari tincho at tincho.org
Thu Mar 2 06:43:39 UTC 2017


Hi Tim,

On 14/02/17 13:42, Tim Small wrote:

> 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).

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.

> 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

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?

> 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?).

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.

-- 
Martín Ferrari (Tincho)



More information about the Pkg-go-maintainers mailing list