GoogleCloudPlatform / GoogleCloudPlatform/k8s-stackdriver

[P0] event-exporter: migrate watcher to events.k8s.io/v1 to reduce event churn

Open
#1,028 0 comments 0 reactions 0 assignees View on GitHub
area/event-exporter enhancement go kind/feature priority/critical-urgent
Dominant language
Go
Stars
409
Forks
236
Avg merge
2h 34m
Merged PRs (30d)
9

Description

## Problem
`event-exporter` watches `core/v1` Events. These objects are updated frequently (count/lastTimestamp), generating high update volume and write amplification to Cloud Logging under heavy load. This increases CPU, memory, and egress in large clusters.

## Proposed optimization
Switch the event watcher to `events.k8s.io/v1` and map `EventSeries` to reduce update frequency. In the newer Events API, repeated events are represented as a series (`series.count`, `series.lastObservedTime`) rather than continuous updates to a single core/v1 Event. This should significantly reduce update traffic and improve throughput in high-volume clusters.

## Notes / references
- Events API group: https://kubernetes.io/docs/reference/kubernetes-api/cluster-resources/event-v1/
- EventSeries semantics: https://kubernetes.io/docs/reference/kubernetes-api/cluster-resources/event-v1/#EventSeries
- client-go typed client: `k8s.io/client-go/kubernetes/typed/events/v1`

## Acceptance criteria
- Watcher uses `events.k8s.io/v1` client and handles `EventSeries` semantics.
- Observed reduction in update volume vs. `core/v1` (documented via metrics or basic benchmarking).
- Backward-compatible behavior for log entry fields used by sink (no loss of required data).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.