kubernetes-sigs / karpenter

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
Apache License 2.0
637 stars 206 forks source link

Abstract prometheus metrics into interfaces #1801

Closed jonathan-innis closed 1 week ago

jonathan-innis commented 2 weeks ago

Fixes #N/A

Description

This leverages https://github.com/awslabs/operatorpkg/pull/92 to create abstract metrics so that you can create an arbitrary pipeline for routing metrics beyond prometheus

For instance,

status.TerminationDuration = pmetrics.NewMultiObservation(
    status.TerminationDuration,
    pmetrics.NewEMFObservation(writer, "operatorpkg", "operator_termination_duration_seconds", []string{"group", "kind", "namespace"}),
)

How was this change tested?

make presubmit

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

k8s-ci-robot commented 2 weeks ago

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

k8s-ci-robot commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonathan-innis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/karpenter/blob/main/OWNERS)~~ [jonathan-innis] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 11748062451

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/disruption/multinodeconsolidation.go 0 1 0.0%
pkg/controllers/disruption/singlenodeconsolidation.go 0 1 0.0%
pkg/cloudprovider/metrics/cloudprovider.go 0 14 0.0%
<!-- Total: 110 126 87.3% -->
Files with Coverage Reduction New Missed Lines %
pkg/controllers/provisioning/scheduling/preferences.go 7 86.67%
<!-- Total: 7 -->
Totals Coverage Status
Change from base Build 11747362633: -0.1%
Covered Lines: 8453
Relevant Lines: 10463

💛 - Coveralls