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

Telegraf alt_baro datatype conversion #144

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Telegraf alt_baro datatype conversion #144

merged 1 commit into from
Oct 9, 2023

Conversation

ngen15
Copy link
Contributor

@ngen15 ngen15 commented Oct 9, 2023

The alt_baro readsb metric produces either a numeric value or the string "ground".

Prometheus doesn't support strings as metrics and will ignore strings. Therefore, there is no problem with Prometheus having a forced data type.

In the case of InfluxDB 2, the first value of the key submitted will define the data type of that field. When "ground" is the first value, Influx will only populate the field when the value is "ground" and fire an error that Influx couldn't convert float to string. This will cause no altitude metrics to be collected.

To keep InfluxDB metrics in line with Prometheus, the data type must be forced as a float.

This does not affect Prometheus since it's dumping strings anyway, and it brings Influx data on par with the Prometheus data.

Further work needs to be done to collect the "ground" value to retain the data, but this will fix the issue of starting a new bucket and not gathering altitude metrics.

The alt_baro readsb metric produces either a numeric value or the string "ground".

Prometheus doesn't support strings as metrics and will ignore strings. Therefore, there is no problem with Prometheus having a forced data type.

In the case of InfluxDB 2, the first value of the key submitted will define the data type of that field. When "ground" is the first value, Influx will only populate the field when the value is "ground" and fire an error that Influx couldn't convert float to string. This will cause no altitude metrics to be collected.

To keep InfluxDB metrics in line with Prometheus, the data type must be forced as a float.

This does not affect Prometheus since it's dumping strings anyway, and it brings Influx data on part with the Prometheus data.

Further work needs to be done to collect the "ground" value to retain the data, but this will fix the issue of starting a new bucket and not gathering altitude metrics.
@kx1t kx1t merged commit 36636e3 into sdr-enthusiasts:main Oct 9, 2023
10 checks passed
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