racing icon indicating copy to clipboard operation
racing copied to clipboard

telemetry ingress restrictions

Open durandom opened this issue 2 years ago • 4 comments

Influx will create the schema on the fly, i.e. the first time it sees a field, it will create the field with the data type. This opens up our pipeline to spam and schema corruption. Let's be a bit more strict and clean up our telegraf.conf

  • only allow the crewchief topic (remove crewchief_v2 and racing)
  • either don't use the mqtt_consumer.json_v2.object parsing and be specific about the fields
  • or keep using it and restrict the fields

documentation is at

  • https://www.influxdata.com/blog/mqtt-topic-payload-parsing-telegraf/
  • https://github.com/influxdata/telegraf/blob/release-1.27/plugins/inputs/mqtt_consumer/README.md
  • https://github.com/influxdata/telegraf/tree/release-1.27/plugins/parsers/json_v2

durandom avatar Aug 16 '23 15:08 durandom

maybe we have to upgrade our telegraf from 1.22 to 1.27

durandom avatar Aug 16 '23 15:08 durandom

{
  "time": 1692204578177,
  "telemetry": {
    "Clutch": 0,
    "Brake": 0,
    "Throttle": 0.9999999,
    "Handbrake": 0,
    "SteeringAngle": 0.000227941709,
    "Rpms": 5677.957,
    "Gear": 3,
    "SpeedMs": 42.3292656,
    "DistanceRoundTrack": 2140.64087,
    "WorldPosition_x": 489.178741,
    "WorldPosition_y": 6.152093,
    "WorldPosition_z": 11.3597507,
    "CurrentLap": 5,
    "CurrentLapTime": 31.9163818,
    "LapTimePrevious": 73.70654,
    "CurrentLapIsValid": true,
    "PreviousLapWasValid": false,
    "CarClass": "GT3"
  }
}

and https://gitlab.com/mr_belowski/CrewChiefV4/-/blob/master/CrewChiefV4/mqtt_telemetry.json

durandom avatar Aug 16 '23 15:08 durandom

/kind feature /assign goern

goern avatar Aug 17 '23 07:08 goern

maybe we have to upgrade our telegraf from 1.22 to 1.27

implemented by #381

goern avatar Aug 17 '23 14:08 goern