Solved Minetest prometheus support

Hello,

I do host a games/minetest instance on my server, which I do build from the ports tree. The Minetest github page has this CMake option:

ENABLE_PROMETHEUS=OFF - Build with Prometheus metrics exporter (listens on tcp/30000 by default)

Which cannot be enabled through the ports configuration, so I have to always manually enable it by editing the Makefile, by changing the


Code:
CMAKE_ARGS=     -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \ 
                -DENABLE_SYSTEM_JSONCPP=ON

to

Code:
CMAKE_ARGS=     -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \ 
                -DENABLE_SYSTEM_JSONCPP=ON \
                -DENABLE_PROMETHEUS=ON

Is there way to automate this, so that I wouldn't need to add this line every time the game updates, or should this be reported to the port maintainer through some channel, so he could add the configuration option to the port?

I was not sure, should this thread be on this or in the ports section of the forum.
 
You can email the maintainer to add the option. However, it shouldn't be enabled by default. Once the option becomes available, to automatically enable that on your computer, use make.conf:
Code:
games_minetest_SET=PROMETHEUS
or for setting it for all ports
Code:
OPTIONS_SET=PROMETHEUS
That of course depends on the actual name of the option, when it becomes available.

I don't know of a way to add an override such as a patch or secondary Makefile to that Makefile to make an available option that persists which is only available on your computer.
 
I sent email to the maintainer and got help about this issue. Just adding -DENABLE_PROMETHEUS=ON to the Makefile actually doesn't work, because Prometheus support requires prometheus-cpp, which currently isn't in ports tree. I don't remember did I have prometheus-cpp installed in the past or has the implementation changed. Anyhow, it's no use to add option unless port is created for prometheus-cpp.
 
So, JazzSinatra can you test the port for functionality?


You only need to install cmake and ninja for building it locally.

Note: This is only a draft, if functionality is given, i will improve the makefile during submission. But i do like suggestions for improvements here anyway :)
 
Back
Top