Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map json prop as labels #74

Open
v0l opened this issue Nov 11, 2021 · 2 comments
Open

Map json prop as labels #74

v0l opened this issue Nov 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@v0l
Copy link

v0l commented Nov 11, 2021

Hi,

It would be nice to be able to map some properties as labels to help identify devices which publish to a single topic.

I have a use case with rtl_433 which is collecting weather station data into a single topic at rtl_433/{hostname}/events

Here is an example json:

{
   "time":"2021-11-11 14:18:45",
   "model":"Fineoffset-WHx080",
   "subtype":0,
   "id":196,
   "battery_ok":1,
   "temperature_C":13.1,
   "humidity":90,
   "wind_dir_deg":135,
   "wind_avg_km_h":1.224,
   "wind_max_km_h":3.672,
   "rain_mm":58.5,
   "mic":"CRC"
}

It would be useful to be able to map id or model to labels to help identify the device event.

- prom_name: temperature
  mqtt_name: temperature_C
  type: gauge
  labels:
  - model
  - id
  - subtype
@hikhvar
Copy link
Owner

hikhvar commented Nov 11, 2021

I can relate to that use case. I welcome a PR adding this functionality. If I have enough spare time, I may implement it myself, but I can not give any time estimates on that.

@v0l
Copy link
Author

v0l commented Nov 11, 2021

I don't have much experience with Go but I can try to give it a shot if I get a chance..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants