prometheus-cpp icon indicating copy to clipboard operation
prometheus-cpp copied to clipboard

sample program gives 404:" not found

Open DigiTester opened this issue 8 years ago • 3 comments

I'm running CentOS Linux release 7.5.1804 with both clang and gcc present, and I faked up a makefile with the various dependencies and the three prometheus libraries in it.

The build lines I'm using are (it might be handy to add those to the readme just to save every single user having to discover them for themselves). I don't have ctest installed so don't have the test output:

clang++ -Wall -pedantic -Wno-vla   -c -g -Werror -std=c++14 -MMD -MP -MF "build/Debug/CLang-Linux/main.o.d" -o main.o main.cpp
clang++ -Wall -pedantic -Wno-vla    -o demo main.o -lprometheus-cpp-push -lprometheus-cpp-pull -lprometheus-cpp-core -lpthread -lgomp -lz

The problem is that when I run that I get an http server but nothing useful out of it:

$ ../demo
(then in another terminal)
$ wget 127.0.0.1:8080
--2018-10-15 13:50:32--  http://127.0.0.1:8080/
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-10-15 13:50:32 ERROR 404: Not Found.

With the demo program stopped there's no server there:

$ wget 127.0.0.1:8080
--2018-10-15 13:51:41--  http://127.0.0.1:8080/
Connecting to 127.0.0.1:8080... failed: Connection refused.

"printf" instrumentation says the loop is running, but the http side isn't producing anything useful.

I'd like to use prometheus but I'm a bit at a loss.

DigiTester avatar Oct 15 '18 03:10 DigiTester

Hello, if not specified the exposer.h defaults the URL path to /metrics the kind of standard for Prometheus metrics.

Would you please create a pull request to update the documentation with the necessary make flags?

Thanks, Gregor

gjasny avatar Oct 15 '18 09:10 gjasny

thanks

DigiTester avatar Oct 16 '18 03:10 DigiTester

I don't have anything useful to add to the readme, sorry, because I haven't worked out how to write makefiles (I use an IDE)

Is there a better place to ask for help than submitting issues here? I've tried SO but it's a bit blank. https://stackoverflow.com/questions/52883657/usage-guidelines-for-prometheus-c

DigiTester avatar Oct 18 '18 22:10 DigiTester