Why teams collect Kubernetes events with OpenTelemetry
Platform teams need cluster events such as scheduling failures, evictions and image pull errors to be searchable for longer than the Kubernetes API server keeps them. Events are short-lived by design, so an investigation that starts a day after an incident often finds nothing left to read. The Kubernetes events receiver in the OpenTelemetry Collector turns those events into log records that can be shipped to a store you choose, where they can be queried, correlated with workload logs and kept under your own retention rules.
The receiver fits when you want events as a durable, searchable stream and already run or plan to run an OpenTelemetry pipeline. It is not a backend. OpenTelemetry is a framework and toolkit for generating, exporting and collecting telemetry, and storage, search and visualization are left to separate tools. Before you build, confirm which backend will hold events, who can query them, and how long they must be kept. Those answers, not the Collector, set the retention you actually get.
The project is open source under the Apache-2.0 license, which is the same license that covers Kubernetes itself, so the components can be reviewed and built into your own distribution. The Collector can run as an agent beside workloads or as a gateway that accepts data from many sources. For events, the placement decision matters because a receiver that watches cluster-wide state should run in one place to avoid duplicate records. Check the component's stability level in its README before you rely on it in production.
Choosing between the events receiver and the objects receiver
The Kubernetes events receiver reads the cluster's event stream and turns each event into a log record, so messages such as scheduling failures, image pull errors and failed probes become searchable next to your application logs. Events describe something that happened to an object. The objects receiver works from the objects themselves, so it reports the state of resources such as pods and deployments as they are read or change. The two sources answer different questions, and a pipeline can use both.
- Event records. Each event carries its reason, message, involved object and type, which makes it useful for building a timeline.
- Object state. The objects receiver records the resource itself, so you can see configuration and status at a point in time.
- Retention. Events are kept in the cluster for a limited time, so the history you can query depends on what your pipeline stores.
- Volume. Object collection usually produces more records than event collection, because every tracked object contributes data.
- Scope controls. Confirm in each component's README which namespace, kind and mode settings are available.
Before you design dashboards, confirm the fields each receiver emits in the version you plan to deploy so your queries match the log schema.
The events receiver fits when the question is what the cluster did and when it did it. Scheduling decisions, evictions, restarts and volume mount failures appear in events, and an incident review often starts with exactly this sequence. Setup is comparatively small because the receiver reads one stream. By default it authenticates with the pod's service account, and the README also documents no authentication and kubeconfig options, so the Collector's RBAC rules decide what it can read.
- Incident timelines. Events give an ordered record of cluster actions that metrics alone do not show.
- Familiar tooling. Platform and on-call teams can search events in the same backend as their other logs.
- Narrow permissions. Grant read access to events in the namespaces in scope, not to Secrets or unrelated resource types.
- Gaps during restarts. Running a single instance avoids duplicate records, but a restart or rescheduling can leave a gap, so plan how you will detect it.
- Retention planning. Because the cluster keeps events for a limited time, set backend retention with your platform team in mind.
Ask your platform team how long the cluster keeps events and which namespaces must be covered before you set the receiver's scope.
The objects receiver fits when you need the state of resources, such as which configuration a workload had at a given time or how a resource changed between two points. Events alone rarely answer those questions, because they describe actions and not the full object. The trade-off is volume and API server load. Each tracked object adds records, and each watch or read adds work for the control plane, so collection should be limited to the kinds and namespaces that support a named use case.
- Configuration history. Object snapshots show what a resource looked like when a problem began.
- Broader resource coverage. You can collect kinds that events do not describe well.
- Load on the API server. Measure the expected read load with your platform team before enabling broad collection.
- Overlap with metrics. Cluster object state also appears in cluster-level metrics, so decide which signal answers each question to avoid paying for the same data twice.
- Access scope. The service account needs read access to every kind collected, so review those roles as carefully as you would for events.
Confirm the current modes, kinds and access requirements in the objects receiver documentation for your Collector version before you enable it.
Both receivers belong to the Collector's contrib distribution, and the project documents stability separately for each component in its README. Stability can differ between a receiver, its configuration options and its emitted fields, and it can change between releases. Core Collector components also have mixed stability levels, so a pipeline can combine stable and in-development parts. Treat the README as the authority for the version you deploy, and record the stability level you accepted in your design notes.
- Stability level. Read the level stated for the receiver and for each option you plan to use.
- Distribution. Confirm the distribution you build or pull includes the receiver.
- Version pinning. Pin the Collector version and review release notes before upgrading.
- Staging test. Run the configuration in a non-production cluster and compare the emitted records with cluster events.
- Current status. Check the project's status information again before production approval, because stability labels can change.
Before committing, check the events receiver README and the objects receiver documentation for the version you plan to run, and record the stability level you accepted.
How the events receiver authenticates to the API server
The Kubernetes events receiver authenticates with the pod's service account by default, so a Collector running in the cluster needs no credentials in its configuration. The Kubernetes events receiver also supports no authentication and a kubeconfig file. For most in-cluster deployments the service account is the right choice: the token is mounted by Kubernetes, rotates without manual work, and the permissions are visible as RBAC objects you can review. A kubeconfig suits a Collector running outside the cluster, but it places a long-lived credential on a host you must then protect, rotate and audit. The no-authentication option is only useful against a local or test API endpoint and should not be used against a production cluster.
Whatever identity the receiver uses needs read access to events, and nothing more. Create a ServiceAccount for the Collector, a ClusterRole that grants only get, list and watch on the events resource in the core and events.k8s.io API groups, and a ClusterRoleBinding to that account. Grant cluster scope only if you need events from every namespace. For a narrower scope, use a Role and RoleBinding in each namespace you want to read. Do not grant write verbs or wildcard resources. Confirm the exact API groups and verbs against the receiver's README and the version of the Collector you run, because the required permissions can change between releases. Ask your platform team to test the binding with kubectl auth can-i --as before deployment.
The Collector's own listening endpoints are a separate exposure to check. Since Collector v0.110.0, server components bind to localhost by default rather than 0.0.0.0, so an endpoint is reachable only from inside the pod unless you change that. Keep it that way unless a specific receiver must accept remote traffic. When you do expose an endpoint, put an authenticator extension in front of it, such as the OIDC authenticator for incoming connections, and follow the Collector security guidance on encrypting and authenticating endpoints. The events receiver itself makes outbound calls to the API server, so the main controls are the RBAC scope and the protection of any kubeconfig file.
Configuration options and when each fits
This table compares the three authentication modes the Kubernetes events receiver supports, the single-instance and multi-instance deployment shapes, and the two retention approaches. Read each row against your cluster layout and your back end's retention policy, then confirm the items in the last column before you choose.
| Option | When it fits | What to confirm |
|---|---|---|
| Service account (default) | The Collector runs inside the cluster it watches, and its service account can be granted read access to events through RBAC | The ClusterRole covers events in every namespace you need, and the service account is bound only to the Collector workload |
| No authentication | Local testing against an API server reachable without credentials, such as a throwaway lab cluster | Not suitable for production clusters, since the API server must accept unauthenticated reads from the Collector |
| Kubeconfig file | The Collector runs outside the cluster, or in another cluster, and must read events from a remote API server | Who owns the kubeconfig, how it is mounted and rotated, and whether its credentials are scoped to read-only event access |
| Single Collector instance | Small clusters or pilots where a short gap in event capture during a restart is acceptable | Whether events emitted during a restart are lost or replayed from the API server, and how your team is alerted when the instance is down |
| Several Collector instances | Larger clusters where event capture must survive the loss of one instance | Whether the receiver deduplicates events across instances, which may produce duplicate log records, and how duplicates are handled downstream |
| Backend retention | Your logging back end already holds Kubernetes logs for the period your operations and audit teams need | The retention period set on the back end, the index or tenant that receives events, and who approves changes to it |
| Collector buffering | The back end is intermittently unavailable, or you need a short local queue so events survive brief outages | The queue size and storage configured on the Collector, and whether a restart or node loss can discard queued events |
How cluster events flow from the API server to search
The flow starts at the Kubernetes API server, which holds the event objects. The Collector's Kubernetes events receiver reads them using the pod's service account by default, so the RBAC binding on that account decides what is visible. Events then pass through processors and an exporter into a separate log backend, which sits outside the cluster boundary. Check the RBAC grant, the single-instance placement, and the export path that crosses the boundary.
Event flow from the API server through the Collector to a separate log backend.
Setting up the events receiver step by step
This sequence takes a cluster from no event collection to a single Collector instance that reads Kubernetes events under its own service account and ships them to a log backend. Each step ends with a check, so the team knows the receiver is working before it moves on.
Confirm the Collector distribution includes the receiver
The platform engineer checks that the Collector image in use includes the Kubernetes events receiver, which lives in the contrib distribution. Start by listing the components in the build or image manifest, or by running the Collector's component listing command against the exact image tag you plan to deploy. If the receiver is missing, switch to a distribution that includes it or build a custom Collector with the Collector Builder, adding only the components you need. The step is done when the receiver appears in the component list for the pinned version.
Create the service account and RBAC
The cluster administrator creates a dedicated service account in the namespace where the Collector will run, then binds a read-only role to it that allows get, list and watch on events in the scope you intend to collect. The receiver uses the pod's service account by default, so the Collector pod must be set to use this account. Avoid cluster-wide admin roles and keep the Collector out of the default service account. Verify the binding with an authorization check that impersonates the service account and confirms it can list events but cannot delete them or read secrets.
Deploy a single Collector instance
The platform team deploys the Collector as one replica, using a Deployment rather than a DaemonSet, so that only one process reads the cluster event stream. Set the pod to use the service account from the previous step and pin the image to the version you tested. Confirm that the pod reaches the ready state and that its logs show no authorization errors when the receiver starts. A single replica is the simplest way to avoid duplicate event records, so keep the replica count at one until you have a reason to change it.
Configure the receiver and a log exporter
Add the Kubernetes events receiver to the logs pipeline with authentication set to the service account, then connect an exporter to the log backend your team uses. Decide which namespaces to watch and keep that scope aligned with the RBAC role. Apply the configuration and let the Collector reload. The step is complete when the Collector reports the pipeline as started and the exporter reports no connection errors to the backend. Ask the backend owner to confirm the expected field names and index settings before you send production traffic.
Verify that events arrive in the backend
Generate a known event in a test namespace, for example by creating and deleting a short-lived pod, then search the log backend for that event. Check that the record contains the event reason, involved object, namespace and timestamp. If nothing arrives, review the Collector logs for authorization or exporter errors and confirm the RBAC scope covers the test namespace. The step is done when the test event appears with the fields your team needs for investigation.
Check for duplicates after restarts
Restart the Collector pod deliberately and watch how the receiver resumes. Then count the test events in the backend for the same time window and compare them with the expected number. Repeated records after a restart indicate that the receiver replayed recent events, which is a known behavior to check for in your version. Record the result and agree with the backend owner how duplicates will be handled, either by deduplicating at query time or by tuning the pipeline. Confirm the findings against the receiver README for your release before you rely on them in production.
Why running one events receiver instance matters
The Kubernetes events receiver watches the cluster API and turns events into log records, so how many copies run and how they restart decides whether you get duplicates, gaps or both. The cards below cover the risks of multiple instances, how a single instance changes restart behavior, and how to confirm the receiver's behavior in the version you deploy.
Duplicate events from parallel instances
If two receiver instances watch the same cluster, each one can emit a log record for the same event. Your backend then shows two copies, inflating counts in dashboards and alerts that count events by reason. Check whether your receiver version deduplicates across instances, and whether your deployment mode can start more than one replica by accident, such as a Deployment scaled above one replica or a second Collector configured with the same receiver.
Events receiver READMEOne watcher per cluster
Running exactly one receiver instance for each cluster gives you a single stream of events with a clear owner. This is the simplest way to avoid duplicates, but it also means that one Collector pod carries the whole event load for that cluster. Confirm in your own environment that the Collector deployment is pinned to one replica and that no DaemonSet or second pipeline also includes the receiver.
Restart gaps in event coverage
When the single instance restarts, rolls out a new version or moves to another node, events that fire during the gap may not reach your logs. Kubernetes events are short-lived objects with their own expiry, so a long gap can mean lost history. Test a rollout in a non-production cluster, create a known event during the restart, and check whether it appears in your backend.
Failover without a second active watcher
Leader election or a warm standby can cover restarts, but a second active watcher reintroduces duplicate events unless the design coordinates which instance writes. Confirm with the receiver documentation and your Collector distribution whether any built-in coordination exists in your version. If none does, plan for a short, accepted gap and document the recovery steps instead of running two watchers.
Service account scope affects every instance
By default the receiver authenticates to the API server with the pod's service account. Every replica or restarted pod uses the same identity, so the RBAC grant must allow list and watch on events across the namespaces you want covered. Verify the grant with a test query from the service account before you rely on the pipeline, since a missing permission can look like a silent gap rather than an error.
Gap handling in your backend
Your log backend should show when the receiver was last healthy, so gaps are visible rather than mistaken for quiet clusters. Track the Collector's own health signals and alert when the events pipeline stops producing records for longer than expected. Agree with the team who owns alerts what a missing event stream means, and record how restarts and upgrades are scheduled.
Questions teams ask before collecting Kubernetes events
What drives the cost of collecting Kubernetes events with OpenTelemetry?
The cost comes mostly from the people time to design, configure, test and hand over the pipeline, plus the storage and query cost of the back end that holds the events. The Collector itself is open source under Apache-2.0, so there is no license fee for the receiver. Effort rises with the number of clusters, the back end you choose, how many teams need access to the logs, and whether alerting and dashboards are part of scope. Ask any partner for a quote that separates one-time build work from recurring items such as upgrades, retesting and back-end capacity.
How long does setup take for an events pipeline?
Duration depends on your environment more than on the receiver itself. A single cluster with an existing Collector deployment and a back end already in place is a much smaller job than a multi-cluster estate with new RBAC approvals, a new log store and change control. Factors to confirm include how quickly your platform team can approve a ClusterRole, whether a Collector is already running, which back end receives the logs, and how many environments must be tested before production. A written scope should state the environments and the acceptance checks, which is what makes a timeline meaningful.
What does our team need to provide for this work?
You need to supply cluster access for the build and test environments, the Kubernetes version and distribution in use, the back end that will store events, and a named owner who can approve RBAC and service account changes. Your security team should review which namespaces the receiver may read, because cluster-wide event access can expose sensitive object names and messages. Expect to provide a test namespace where events can be generated on demand so the pipeline can be verified before it reaches production.
Can our own platform team set this up without a partner?
Yes, if your team already runs the OpenTelemetry Collector and is comfortable with Kubernetes RBAC and Collector configuration. The receiver authenticates with the pod's service account by default, so the main work is granting that account read access to events and deploying one Collector instance correctly. Teams without that experience often underestimate the verification and retention decisions. A partner is most useful when the scope spans several clusters, a compliance review or a hardening requirement that your team cannot staff this quarter.
Should we use the Kubernetes events receiver or the Kubernetes objects receiver?
Use the events receiver when you want a stream of Kubernetes event objects as they are emitted, which is the usual choice for troubleshooting history such as scheduling failures and image pull errors. Use the objects receiver when you need the state of resources, or changes to them, captured as log records. The two can overlap, so decide which question the logs must answer before building dashboards. Confirm the exact behavior of the version you deploy against the receiver's README, since component stability varies across the Collector.
How is retention set for Kubernetes events?
Retention is set in the log back end, not in the Collector. Kubernetes keeps events only for a limited time in the API server, so the pipeline must export them to a store that keeps them for the period your operations and audit needs require. Decide the retention period per environment, the storage tier and who may query older data. Ask your back-end vendor or team to confirm how retention policies, indexing and deletion work, and keep the policy under change control.
Why does running a single instance matter for events?
Running more than one instance that reads the same cluster events can produce duplicate log records, which skews counts and alerts. A single Collector instance dedicated to cluster-level event collection avoids that, while node-level collection can run elsewhere. The trade-off is that a single instance is a single point of failure, so plan restart behavior, resource limits and monitoring of the Collector itself. Confirm how your chosen deployment mode and receiver version handle leader election or restarts before relying on the pipeline.
What security controls apply to event collection?
Events can contain object names, error messages and sometimes sensitive details, so treat the pipeline as a data path with access controls. Grant the service account only the read permissions the receiver needs, store the Collector configuration securely, and use the redaction processor if messages may include sensitive values. Authenticating the Collector to your back end and restricting who can query the logs are equally important, and your security team should review both before production.
How DeployOpen scopes and delivers event collection
Event collection starts with a written scope, agreed before any work begins. For a Kubernetes events pipeline, that scope names the clusters and their Kubernetes versions, the namespaces the receiver will watch, the back end that stores the events, the authentication method for the receiver (service account by default, or a kubeconfig, or no authentication), and the single Collector instance that runs the receiver. Each of these choices changes the RBAC objects, the Helm values and the test plan, so DeployOpen records them in the scope document rather than leaving them to the build. The deliverables are listed the same way: the deployed Collector configuration, the ClusterRole and binding that allow the receiver to list and watch events, the retention settings on the back end, a verification checklist and a handover runbook. Fixed scope gives the client a price tied to this list and a clear point at which the work is done.
Testing happens against the cluster versions the client actually runs, not against the latest release. Kubernetes maintains the three most recent minor releases, so a client on an older supported minor needs its own test pass, and the event fields and API behavior that the receiver reads should be confirmed on that version before go-live. DeployOpen documents the RBAC and configuration as built, including the service account, the verbs and resources granted and the reason each one is needed, so a security reviewer can check the least-privilege claim without reading the Collector source. Clients should ask for this document in the quote and confirm that the receiver's current release notes match the Collector version they plan to deploy.
Kubernetes and the Collector both change on their own schedules, so the work does not end at handover. Kubernetes ships new minor releases roughly three times a year, and the Collector publishes new releases every few weeks. Upgrade support, release-by-release testing of the events pipeline and periodic RBAC reviews can be covered by a retainer, which is priced separately from the initial build. Clients should ask whether the retainer includes retesting after each cluster upgrade and how the team will be notified of breaking changes in the receiver.

