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

Sensor name filtering #10

Merged
merged 2 commits into from
May 25, 2020
Merged

Sensor name filtering #10

merged 2 commits into from
May 25, 2020

Conversation

oxplot
Copy link
Contributor

@oxplot oxplot commented May 21, 2020

Adds a new config option sensor_name_filter which is a regular expression. This is useful for when different types of sensors present different metrics under the same metric name.

@hikhvar
Copy link
Owner

hikhvar commented May 21, 2020

I think this is a valid use case. However, this PR might not solve the problem. Given a mqtt metric state. Two types of sensors (a, b) use this name to represent different logical metrics state_a and state_b. With your implementation we can either filter for either a or b. The other state will be dropped. Is this intended?

@oxplot
Copy link
Contributor Author

oxplot commented May 21, 2020

Is this intended?

No. And I see — the shape of the config file threw me off. I missed that a map is constructed to based on MQTT name.

I think the ingestor should iterate over all the rules and apply the first matching one.

@oxplot
Copy link
Contributor Author

oxplot commented May 24, 2020

Done

@hikhvar
Copy link
Owner

hikhvar commented May 25, 2020

LGTM. Thank you!

@hikhvar hikhvar merged commit ebeed6e into hikhvar:master May 25, 2020
@oxplot oxplot deleted the sensor-name-filtering branch May 29, 2020 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants