Closed guettli closed 3 months ago
What this PR does / why we need it:
Sometimes we want to see all calls to the hcloud api (to debug rate-limiting issues).
You can test the client on its own with this file in a new directory:
package main import ( "context" "fmt" "log/slog" "os" "github.com/go-logr/logr" hcloudclient "github.com/syself/cluster-api-provider-hetzner/pkg/services/hcloud/client" ) func main() { c := hcloudclient.NewFactory().NewClient(os.Getenv("HCLOUD_TOKEN")) fmt.Println(c.ListServerTypes(logr.NewContextWithSlogLogger(context.Background(), slog.New(slog.NewTextHandler(os.Stdout, nil))))) }
above code is for checking our logs.
Now checking that we did not break the metrics:
❯ k -n caph-system port-forward caph-controller-manager-5b68dcd5c9-jmngs 8080:8080
❯ curl http://localhost:8080/metrics > metrics.json
metrics.json
@janiskemper I extracted the "WithEventFilter" related changes to the new PR: https://github.com/syself/cluster-api-provider-hetzner/pull/1355/files
What this PR does / why we need it:
Sometimes we want to see all calls to the hcloud api (to debug rate-limiting issues).
You can test the client on its own with this file in a new directory:
above code is for checking our logs.
Now checking that we did not break the metrics:
metrics.json