Skip to content

Conversation

@seethedoor
Copy link

@seethedoor seethedoor commented Mar 14, 2024

Now we have metrics of events_sent, which means total calculation of events sent from api-server and received by the event-exporter. But we don't have metrics to show how many events matched and sent to receivers we defined.

This PR supports metrics of events-matched metrics. It will create metrics named event_exporter_events_matched, and the matched rule name is given as a tag of the metrics. All the matched events will be calculated to different tags of the event_exporter_events_matched metrics. like this:

  • rule example
route:
  routes:
    - match:
        - receiver: "alerts"
          reason: "FailedScheduling"
          name: "FailedScheduling"
    - match:
        - reason: ScalingReplicaSet
          receiver: alerts
          name: "ScalingReplicaSet"
    - match:
        - reason: Kill
          receiver: alerts
  • metrics example
event_exporter_events_matched{route="FailedScheduling"} 2
event_exporter_events_matched{route="ScalingReplicaSet"} 12
event_exporter_events_matched{route="default"} 15

name property of rule can be defined, and if it is empty, the matched events will be calculated to the metrics with default name-tag.

issue: #169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant