Skip to content

Commit d2d1c76

Browse files
authored
Expose Linode Client Prometheus metrics (#302)
* Expose Linode Client Prometheus metrics Add `--authorization-always-allow-paths="/metrics"` to command line to allow scraping these metrics. In addition to Linode Client metrics, standard controller and worqueue metrics are visible by default. To disambiguate CCM node controller work queue name, it's explicitly named "ccm_node". That is, "node", "service" are upstream work queues of k8s cloud-provider service controller and "ccm_node" is the work queue of Linode CCM node controller. Fixes #296 * Ignore coverage for client_with_metrics.go * Add allowUnauthorizedMetrics Helm value * Move metrics docs to getting-started sections * Instrument healthChecker with Prometheus metrics * Update newHealthChecker tests * Preserve initialization order * Remove unused timeout variable in healthChecker * Remove unnecessary err return in newHealthChecker
1 parent 8d34ded commit d2d1c76

15 files changed

+569
-48
lines changed

cloud/linode/client/client.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package client
22

33
//go:generate go run github.com/golang/mock/mockgen -destination mocks/mock_client.go -package mocks github.com/linode/linode-cloud-controller-manager/cloud/linode/client Client
4+
//go:generate go run github.com/hexdigest/gowrap/cmd/gowrap gen -g -p github.com/linode/linode-cloud-controller-manager/cloud/linode/client -i Client -t ../../../hack/templates/prometheus.go.gotpl -o client_with_metrics.go -l ""
45

56
import (
67
"context"
@@ -10,6 +11,7 @@ import (
1011
"os"
1112
"time"
1213

14+
_ "github.com/hexdigest/gowrap"
1315
"github.com/linode/linodego"
1416
"k8s.io/klog/v2"
1517
)

0 commit comments

Comments
 (0)