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

AQI telegraf config is outdated. #317

Open
1 task done
sarvesh-lad opened this issue Feb 22, 2023 · 0 comments
Open
1 task done

AQI telegraf config is outdated. #317

sarvesh-lad opened this issue Feb 22, 2023 · 0 comments
Labels
Template Issue A problem with a specific Template

Comments

@sarvesh-lad
Copy link

Template: airquality

Describe the problem
Incorrect telegraf config

To Reproduce
Steps to reproduce the behavior:
Setup AirQuality telegraf agent an you will see error:

2023-02-22T23:20:30Z E! [inputs.http] Error in plugin: [url=AQI_URL]: instantiating parser failed: line 28: (json.Parser.TimeKey) cannot unmarshal TOML array into string (need slice)

The config section giving trouble:

  ## Data format to consume.
  data_format = "json"
  json_time_key = ["DateForecast"]
  json_time_format = "2006 01 02 "
  tag_keys = ["Category_Name", "ParameterName", "Latitude", "Longitude", "ReportingArea"]
  json_string_fields = ["ActionDay"]

Expected behavior
It shouldn't be parsed as an array. It can be easily fixed by changing the time key and format.

  ## Data format to consume.
  data_format = "json"
  json_time_key = "DateForecast"
  json_time_format = "2006-01-02 "
  tag_keys = ["Category_Name", "ParameterName", "Latitude", "Longitude", "ReportingArea"]
  json_string_fields = ["ActionDay"]

Screenshots
If applicable, add screenshots to help explain your problem.

How are you running InfluxDB?

  • InfluxDB 2.0 on a remote server

Additional context
The current output of the AQI request:

[
  {
    "DateIssue": "2023-02-22 ",
    "DateForecast": "2023-02-22 ",
    "ReportingArea": "Dallas-Fort Worth",
    "StateCode": "TX",
    "Latitude": 32.767,
    "Longitude": -96.783,
    "ParameterName": "O3",
    "AQI": -1,
    "Category": {
      "Number": 1,
      "Name": "Good"
    },
    "ActionDay": false,
    "Discussion": "https://www.tceq.texas.gov/airquality/monops/forecast_today.html"
  },
...
]
@sarvesh-lad sarvesh-lad added the Template Issue A problem with a specific Template label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template Issue A problem with a specific Template
Projects
None yet
Development

No branches or pull requests

1 participant