scaphandre icon indicating copy to clipboard operation
scaphandre copied to clipboard

Prometheus metrics formatting is changing after request

Open leonardpahlke opened this issue 2 years ago • 6 comments

Bug description

The exported prmetheus metrics structure changes if I query it from terminal and are only partially in prometheus format.

To Reproduce

  1. start scaphandre via docker
  2. open metrics via browser localhost:8080/metrics
  3. metrics appear and everything is normal also on refresh
  4. curl the website curl localhost:8080/metrics
  5. exported metrics change and only partially comply with Prometheus schema

Expected behavior

exported metrics do not change regardless how i query it

Environment

  • Linux distribution version Fedora 38 workstation
  • Kernel version 6.4.11-200.fc38.x86_64 GNU/Linux

Additional context

cmd to start the container:

docker run -v /sys/class/powercap:/sys/class/powercap -v /proc:/proc -p 8080:8080 -ti hubblo/scaphandre prometheus

leonardpahlke avatar Aug 28 '23 12:08 leonardpahlke

I am able to scrape scaphandre metrics using prometheus without anay issue. Do you have the same issue with docker image hubblo/scaphandre prometheus:dev ?

mmadoo avatar Aug 28 '23 12:08 mmadoo

  1. start scaphandre via docker

  2. open metrics via browser localhost:8080/metrics Screenshot from 2023-08-28 18-17-58

  3. metrics appear and everything is normal also on refresh

  4. curl the website curl localhost:8080/metrics

now the metrics changed? Screenshot from 2023-08-28 18-19-34

leonardpahlke avatar Aug 28 '23 14:08 leonardpahlke

If I run docker run -v /sys/class/powercap:/sys/class/powercap -v /proc:/proc -p 8080:8080 -ti hubblo/scaphandre:dev prometheus I always get to the second screenshot.

This is prob. just a small thing. Which looks to be already solved in the dev image if the metrics in the second screenshot are the expected output? Idk if you can turn off all the extra metrics and go back to the more simplistic overview?

leonardpahlke avatar Aug 28 '23 14:08 leonardpahlke

You screen capture does not show all response, can you export metrics in a file for each case.

mmadoo avatar Aug 28 '23 16:08 mmadoo

sure! logs1.txt

logs2.txt

leonardpahlke avatar Aug 29 '23 10:08 leonardpahlke

the first is 3.2kb, the second one 529.4kb

leonardpahlke avatar Aug 29 '23 10:08 leonardpahlke