PureStorage-OpenConnect / pure-fa-openmetrics-exporter

Pure Storage OpenMetrics exporter for FlashArray
Apache License 2.0
18 stars 26 forks source link

Extended uagent #113

Closed genegr closed 3 months ago

genegr commented 3 months ago

Fixes issue #102

Not immediate to automate testing. A possible option to manual test is by running the container in debug mode, use curl to query a target FA and check the output of the debug log. It should show something like the following, where the User-Agent of the original caller is added into the comment substring


POST  /api/2.30/login  HTTP/1.1
HOST   : 10.225.112.90
HEADERS:
    Accept: application/json
    Api-Token: 77f6c791-e5d3-4381-841e-7ddde4e75c45
    Content-Type: application/json
    User-Agent: Pure_FA_OpenMetrics_exporter/1.0 (curl/7.81.0)
    X-Auth-Token:
BODY   :
***** NO CONTENT *****
------------------------------------------------------------------------------
chrroberts-pure commented 3 months ago

All of the tests need to be updated for the updated NewRestClient function

eg. volumes_test.go:L38

        c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false)
sdodsley commented 3 months ago

@genegr I have validated that the useragent string is being parsed correctly into the dialhome warehouse, so from my side this all good. Let's get @chrroberts-pure points addressed, specifically the case of setting a default value. We can then propagate this change into FlashBlade as well. image

sdodsley commented 3 months ago

All of the tests need to be updated for the updated NewRestClient function

eg. volumes_test.go:L38

      c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false)

Fixed

chrroberts-pure commented 3 months ago

Hi @sdodsley we're missing the updates to the function on internal/rest-client/volumes_performance_test.go