sensu / sensu-influxdb-handler

Sensu Go InfluxDB Metrics Handler
https://sensu.io
MIT License
14 stars 16 forks source link

error on env var parsing #54

Open jesusch opened 1 year ago

jesusch commented 1 year ago

`

api_version: core/v2
type: Handler
metadata:
  name: influxdb
spec:
  type: pipe
  command: sensu-influxdb-handler
  env_vars:
   - INFLUXDB_BUCKET="{{ .Check.Namespace }}"
  filters:
  - has_metrics
  runtime_assets:
  - sensu/sensu-influxdb-handler

`

results in: "msg":"event pipe handler executed","output":"2022/11/16 14:37:10 influxdb2client E! Write error: not found: bucket \"{{.Check.Namespace}}\" not found\nError executing sensu-influxdb-handler: error executing handler: write failed (attempts 0): not found: bucket \"{{.Check.Namespace}}\" not found\n"

I've tried {{.Check.Namespace}} as well as {{.Entity.Namespace}}

Also I've noticed that ENV vars are parsed wrong - even if the are strings e.g.

INFLUXDB_BUCKET="somestring" vs. INFLUXDB_BUCKET=somestring

the first one preserves the quotes (which is wrong?)