resmoio / kubernetes-event-exporter

Export Kubernetes events to multiple destinations with routing and filtering
Apache License 2.0
753 stars 149 forks source link

feat: add prometheus receiver #177

Open cherylfbrown opened 4 months ago

cherylfbrown commented 4 months ago

Adds a Prometheus receiver for emitting event metrics that Prometheus can scrape, along with associated README and config example updates.

Example config used for testing:

      - name: "prometheus"
        prometheus:
          eventsMetricsNamePrefix: "my_test_prefix_"
          reasonFilter:
            Pod:
            - "FailedMount"

Example metric emitted: my_test_prefix_pod_event_count{app="event-exporter", job="kubernetes-pods", kubernetes_namespace="monitoring", kubernetes_pod_name="event-exporter-7db4c957cb-77tbd", namespace="cheryl", pod="c-test-0", reason="FailedMount", version="v1"} 1

closes #160

yuzs2 commented 4 months ago

This feature looks good. When will this be added to the new release? How can we use this now?

PG2000 commented 4 months ago

+1

cherylfbrown commented 4 months ago

@mustafaakin Any outlook on when you might be able to review this PR? Thank you!

sanjaybommalene commented 3 months ago

@cherylfbrown Thanks for adding this feature. This is much needed. I have one suggestion for improvement. As of now, prometheus is scraping all the old events even though are not valid(active) anymore. Can we add a filter to emit event metrics only for active events or use last seen timestamp(event age)?

wang-xiaowu commented 3 months ago

+1 this can be practical

filippos47 commented 2 months ago

We're currently evaluating this tool, this would be an amazing feature!

BFS-JWesseler commented 2 months ago

That would be awesome. :-)

srijan-shukla commented 1 month ago

Hi team, Request to kindly review this PR , a much needed feature !!!

duanhongyi commented 1 month ago

+1

jianxiaoguo commented 1 month ago

+1