Enapter / charts

Enapter Helm Charts
MIT License
48 stars 49 forks source link

KeyDB Exporter extraArgs doesn't work as intended #45

Closed rngcntr closed 2 years ago

rngcntr commented 2 years ago

Follow-up of yesterday's PR. This config:

exporter:
    enabled: true
    extraArgs:
      - count-keys: "some-key*,some-other-key*"

does compile and generate this output:

args:
  - >-
    --count-keys
    "some-key*,some-other-key*"
    \

That, however, causes the exporter to fail with the following log:

flag provided but not defined: -count-keys "some-key*,some-other-key*" \

I did not yet figure out why it says -count-keys instead of --count-keys but I assume that this is part of the issue.

Antiarchitect commented 2 years ago

Will check

Antiarchitect commented 2 years ago

Please take a look at 0.33.3 and tell if it works

rngcntr commented 2 years ago

Sadly, that didn't change anything. I tried a couple of things in a live environment and what seems to work is a structure like:

args:
  - "--count-keys"
  - "some-key*,some-other-key*"

That is the only configuration I figured out where the exporter does not complain about an unknown flag. At this point I am pretty convinced that it currently tries to parse "--count-keys: some-key*,some-other-key*" as an argument name instead of only "--count-keys". I assume that's because helm handles arguments this way. It expects args to be a mixed list of argument names and argument values.

That said, I guess the easiest and most straight-forward way would be to pass the content of extraArgs directly into args. That way, one can configure extraArgs according to helm's default syntax.

Antiarchitect commented 2 years ago

I'll investigate it further.

Antiarchitect commented 2 years ago

Just checked. For me 0.33.3 seems fine:

This config:

  exporter:
    enabled: true
    extraArgs:
      - count-keys: "some-key*,some-other-key*"

Renders:

   - args:                                                                                                                                  │
     - --count-keys "some-key*,some-other-key*"

Helm version is: version.BuildInfo{Version:"v3.8.1", GitCommit:"5cb9af4b1b271d11d7a97a71df3ac337dd94ad37", GitTreeState:"clean", GoVersion:"go1.17.5"}

@rngcntr Please check thoroughly you're using keydb 0.33.3 and Helm fresh enough

rngcntr commented 2 years ago

It does work in the sense that the rendered output is as described. But the metrics exporter can not handle the arguments because it expects --count-keys and `"some-key,some-other-key" to be separate items in the list.

Antiarchitect commented 2 years ago

Now I see. Wait a bit.

Antiarchitect commented 2 years ago

@rngcntr Please check 0.33.4

rngcntr commented 2 years ago

Looks good, thank you very much!

Antiarchitect commented 2 years ago

@rngcntr Thank you for your patient investigation :)