David-Igou / bsbmp-exporter

Prometheus exporter for Bosch Sensortec temperature, atmospheric pressure and humidity sensors
MIT License
9 stars 3 forks source link

Please support scraping multiple sensors #14

Open bdrung opened 3 years ago

bdrung commented 3 years ago

Hi, I own a Raspberry Pi 3 and have two BME280 connected via i2c. Please support scraping both with one instance. The parameter the exporter currently takes could be converted to labels.

Currently running bsbmp-exporter -address="0x76" -bus=1 -model="BME280" will produce metrics like

bsbmp_temperature_celcius 16.350000381469727

This could be changed to include the settings as labels:

bsbmp_temperature_celcius{address="0x76",bus="1",model="BME280"} 16.350000381469727
David-Igou commented 3 years ago

Thanks, I didn't consider a scenario with >1 sensors on one pi - since these are atmospheric probes.. I thought I had read previously that the longest an i2c bus can be is ~1m but a quick google search reveals success has been had with up to 100m.

I am planning to improve the code in the collector within the next month or two, in that time I'll also implement labels.

bdrung commented 3 years ago

Thanks.