Cluster-api-provider-aws: Metrics/Tracing

Created on 11 Sep 2018  路  21Comments  路  Source: kubernetes-sigs/cluster-api-provider-aws

Would be good to get at least metrics added early on.

A cluster operator may want to metrics from the controllers available in their monitoring system of choice, e.g. Prometheus. I would be interested in metrics with regards to the creation, deletion, mutation and failure rates of AWS APIs, and the state of their objects at least to help diagnose when limits have been reached.

Specifically, adding https://opencensus.io/quickstart/go/metrics/ would do this in a vendor agnostic fashion and allow the choice of tracing / metrics system, incl. CloudWatch and AWS X-Ray.

help wanted kinfeature lifecyclfrozen prioritimportant-longterm

All 21 comments

if there's a strong preference for prometheus client_golang, also fine.

We should have some umbrella issue to track this, not sure what the standards is across k8s components.

CC @detiber

From the new KEP, this seems to be important:

Kubernetes also makes extensive use of a global metrics registry to register metrics to be exposed. Aside from general shortcomings of global variables, Kubernetes is seeing actual effects of this, causing a number of components to use sync.Once or other mechanisms to ensure to not panic, when registering metrics. Instead a metrics registry should be passed to each component in order to explicitly register metrics instead of through init methods or other global, non-obvious executions.

While uncertain at this point, once cleaned up, this effort may put us a step closer to having stability guarantees for Kubernetes around metrics. Currently metrics are excluded from any kind of stability requirements.

As we're green field, we have an opportunity to do things right, any advice from @ehashman or @brancz would be appreciated.

The Prometheus client is currently what鈥檚 universally used in Kubernetes. Specifically regarding metrics more important is the standard wire format that both the Prometheus client as well as the opencensus library are going to support (this effort is called OpenMetrics). I have little experience with the opencensus project, it looks promising especially as all signals are instrumented with it, but also rather early stage. Given all of the above I鈥檇 recommend using the Prometheus client library at this point for metrics. Beyond that I recommend not to use the global metrics registry for the same reasons as any global variables (for the record we are actually seeing api metrics leaking into the scheduler in Kubernetes for example because of the use of the global metrics registry). Instead pass the registry down to components just like a logger.

@randomvariable I like this idea very much, should we also track this at the more generic cluster-api level as well?

@vincepri I think we can use this issue as the umbrella issue and spawn out more specific issues to address as identified.

/assign

/milestone Next

On the last attempt at this, it seemed like one of the best ways for instrumenting AWS calls is to use the WithContext methods in the AWS SDK, and add a hook to get stats. It required opening up the HTTP requests to do well, so left it last time.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale

/assign @randomvariable

Will sync with SIG Instrumentation to get latest advice

@randomvariable I assume you're not actively working on this?

Nope, would have lifecycled/active'd it if I were.

I didn't provide an update at the time because I think SIG Instrumentation was in the process of considering OpenCensus, which has been added to container runtime since.

Do you still want to be assigned?

Sure. Now we're upgraded, this is implementable.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/lifecycle frozen

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benmoss picture benmoss  路  5Comments

ishantanu picture ishantanu  路  6Comments

randomvariable picture randomvariable  路  7Comments

chuckha picture chuckha  路  7Comments

michaelgugino picture michaelgugino  路  5Comments