Skip to content

Commit

Permalink
Expose Linode Client Prometheus metrics (#302)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rsienko authored Jan 30, 2025
1 parent 8d34ded commit d2d1c76
Show file tree
Hide file tree
Showing 15 changed files with 569 additions and 48 deletions.
2 changes: 2 additions & 0 deletions cloud/linode/client/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package client

//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
//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 ""

import (
"context"
Expand All @@ -10,6 +11,7 @@ import (
"os"
"time"

_ "github.com/hexdigest/gowrap"
"github.com/linode/linodego"
"k8s.io/klog/v2"
)
Expand Down
Loading

0 comments on commit d2d1c76

Please sign in to comment.