Skip to content

Feature request: We need the ability to control InvolvedObject.Name via a rule. #238

@mk2taiga

Description

@mk2taiga

Hi there,

I will add the following implementation to rule.go.

type Rule struct {
	Labels      map[string]string
	Annotations map[string]string
	Message     string
	APIVersion  string `yaml:"apiVersion"`
	Kind        string
	Namespace   string
	Reason      string
	Type        string
	MinCount    int32 `yaml:"minCount"`
	Component   string
	Host        string
	Name        string // ← add
	Receiver    string
}

rules := [][2]string{
    {r.Message, ev.Message},
    {r.APIVersion, ev.InvolvedObject.APIVersion},
    {r.Kind, ev.InvolvedObject.Kind},
    {r.Namespace, ev.Namespace},
    {r.Reason, ev.Reason},
    {r.Type, ev.Type},
    {r.Component, ev.Source.Component},
    {r.Host, ev.Source.Host},
    {r.Name, ev.InvolvedObject.Name}, // ← add
}

See: https://github.com/resmoio/kubernetes-event-exporter/blob/master/pkg/exporter/rule.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions