event-exporter: prefer events.k8s.io/v1 + add e2e harness#1034
Open
erain wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
Open
event-exporter: prefer events.k8s.io/v1 + add e2e harness#1034erain wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
erain wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
c14f195 to
12e8418
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change migrates the event-exporter watcher to prefer
events.k8s.io/v1while preserving the existingcore/v1sink pipeline. It adds anautoAPI selection mode (default) that uses discovery to pick the best API and safely falls back tocore/v1whenevents.k8s.io/v1is unavailable. It also adds a reusable local E2E harness (kind + build-tagged test), plus unit/integration tests and micro-benchmarks so we can validate parity and capture performance improvements.Fixes #1028.
Key changes
--events-apiflag (defaultauto) resolves toevents.k8s.io/v1when available, otherwisecore/v1.events.k8s.io/v1objects are converted tocore/v1in the watcher handler so the sink, log entry factory, and monitored resource mapping remain unchanged.EventTimewhenLastTimestamp/Seriesare missing.hack/e2e-kind.sh+make e2etarget, documented inevent-exporter/docs/e2e.md.Acceptance criteria (from #1028)
events.k8s.io/v1+ EventSeries: implemented watcher path with conversion and unit/integration coverage.core/v1sink pipeline; log entry fields validated by tests and E2E samples.Testing
go test ./...(fromevent-exporter/)go test ./sinks/stackdriver -bench BenchmarkProcess -benchmemmake e2e(kind)Performance (local kind E2E)
Environment:
Results:
core/v1: processed=200, updates=0, occurrences=200, elapsed=38.59s, throughput=5.18 occ/sevents.k8s.io/v1: processed=21, updates=20, occurrences=200, elapsed=2.40s, throughput=83.39 occ/sBenchmarks (log entry factory)
BenchmarkProcessCoreV1RepeatedEvents: ~4.23ms/op, ~492 KB/op, ~9.8k allocs/op (100 occurrences)BenchmarkProcessSeriesAggregatedEvent: ~0.052ms/op, ~5.7 KB/op, ~116 allocs/op (100 occurrences)Notes
event-exporter/go.modgainsgithub.com/spf13/pflagas an indirect dependency because the E2E test usesclientcmdfor kubeconfig loading.