Skip to content

[k8s/hpa] Add scaletargetref resource attributes to hpa metrics resource attributes #2008

Open
@atoulme

Description

@atoulme

Area(s)

area:k8s

What's missing?

We currently support hpa metrics related to the state of the hpa. We also want to capture the scale target of the hpa with a set of additional resource attributes mapping to the scaleTargetRef portion of the hpa spec: https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/autoscaling/types.go#L80
A scaleTargetRef is represented as a CrossVersionObjectReference which represents a trio of fields:

// CrossVersionObjectReference contains enough information to let you identify the referred resource.
type CrossVersionObjectReference struct {
	// kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
	Kind string

	// name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	Name string

	// apiVersion is the API version of the referent
	// +optional
	APIVersion string
}

Describe the solution you'd like

Define 3 new resource attributes that are added to all hpa metrics, all 3 of type string:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Status

    Need triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions