liveBook · Manning

CDEvents

As explained in Platform Engineering on Kubernetes

CDEvents is an open specification for interoperable events representing activities in software delivery and continuous integration and delivery.

CDEvents is a common specification for events in continuous delivery. CloudEvents provides an envelope for events from different tools, but each tool can define its own payload. CDEvents gives delivery activities a shared meaning, so events from those tools can be filtered, correlated, and used to calculate software delivery metrics. section 9.2 section 9.2.1

Its vocabulary covers activities across the delivery lifecycle:

  • Pipeline orchestration: task runs and pipeline runs. section 9.2.1
  • Source control: repositories, branches, and changes. section 9.2.1
  • Continuous integration: builds, artifacts, and tests. section 9.2.1
  • Deployment and operations: services, environments, and incidents. section 9.2.1

A metrics pipeline can collect CloudEvents, store them, transform relevant events into CDEvents, and aggregate the results. Event sources that do not emit CloudEvents must first be adapted. Transformations depend on the metric and the source: there is no single mapping that fits every tool. In the worked architecture, PostgreSQL stores incoming events and calculations, while components periodically process records that have not yet been handled. section 9.2.2 section 9.2.5

Count Kubernetes deployments

To calculate deployment frequency, map a Knative API server CloudEvent whose type is `dev.knative.apiserver.resource.add` and whose `data.InvolvedObject.Kind` is `Deployment` to a `dev.cdevents.service.deployed.0.1.0` event. A working Kubernetes example collects the events, performs this transformation, and calculates daily deployment counts. Its metrics output includes a deployment name, count, and date. section 9.2.5 section 9.2.7

Figure 9.19 Data flows from Data Sources producing CloudEvents to the CloudEvents endpoint whose only mission is to store these events into the Event Store. From there, the CloudEvents Router have the logic to decide where to route events to transformation functions, which allows us to map CloudEvents to CDEvents for further processing. Once we have CDEvents, the Calculation Functions can read these events to aggregate data and produce metrics. Metrics consumers can get the metrics by interacting with the Metric Endpoint, which will fetch the calculated metrics from the metrics database.

Trace the event from its source through storage, routing, CDEvents transformation, metric calculation, and the endpoint that serves the result. section 9.2.7

The payoff is a reusable model for delivery metrics rather than a separate calculation for every event source. The same event-based approach can also support integrations with other tools. Metrics make delivery bottlenecks and the effects of platform changes easier to assess. section 9.6 section 9.4

How Platform Engineering on Kubernetes covers it

How deep it goes
Defines lifecycle event categories and works through a source-specific deployment mapping, without prescribing mappings for every metric or event source.
Examples
Maps a Knative API server Deployment event to a service-deployed CDEvent and calculates daily deployment counts.
What it assumes
Assumes event sources can supply CloudEvents or be adapted to do so; walks through creating the Kubernetes cluster and installing components.
What you can do after
Build it from scratch as a collection, transformation, and calculation pipeline for deployment frequency.
How it connects
Connects CloudEvents, continuous delivery, Kubernetes events, deployment frequency, and DORA metrics.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Platform Engineering on Kubernetes. The section links point to the parts of the book it draws on.