Help me scrape data!!!

26 views
Skip to first unread message

Gerson Garcia

unread,
Jul 8, 2020, 9:53:09 PM7/8/20
to Prometheus Users
All,

I have exporter that generates the following data:

gerson@mypi4:~ $ curl http://192.168.1.148:9393/metrics
<html>

<head></head>
<body data-gr-c-s-loaded="true">
<pre style="word-wrap: break-word; white-space: pre-wrap;">
# HELP bmp180_temperature_celsius Temperature read from ESP8266 BMP180 sensor
# TYPE bmp180_temperature_celsius gauge
bmp180_temperature_celsius 25.50
# HELP bmp180_pressure_pascal Pressure read from ESP8266 BMP180 sensor
# TYPE bmp180_pressure_pascal gauge
bmp180_pressure_pascal 98704
# HELP bmp180_altitude_meters Altitude read from ESP8266 BMP180 sensor
# TYPE bmp180_altitude_meters gauge
bmp180_altitude_meters 357.87
</pre>
</body>
</html>


And I have the following prometheus scrape configuration:

  - job_name: 'esp8266'
    scrape_interval: 30s
    static_configs:
    - targets: ['192.168.1.148:9393']


But for some reason the job is never up:

Annotation 2020-07-08 204949.jpg


My Prometheus instance is running on a docker container, but it can see other nodes.


Am I doing something wrong with the format of exporter?


Thank you,


Gerson





Gerson Garcia

unread,
Jul 8, 2020, 9:59:10 PM7/8/20
to Prometheus Users
Also, I see it is executed:
Annotation 2020-07-08 2057.jpg

Matt Palmer

unread,
Jul 8, 2020, 11:18:11 PM7/8/20
to Prometheus Users
On Wed, Jul 08, 2020 at 06:53:09PM -0700, Gerson Garcia wrote:
> I have exporter that generates the following data:
>
> gerson@mypi4:~ $ curl http://192.168.1.148:9393/metrics
> <html>

[snip]

What made you think that the scrape data format was HTML? It's not, it's a
straightforward plain-text format.

- Matt

Gerson Garcia

unread,
Jul 9, 2020, 11:15:36 AM7/9/20
to Prometheus Users
Matt,

I removed the html tags and it is working now. Thank you very much,
Reply all
Reply to author
Forward
0 new messages