• Stars
    star
    789
  • Rank 57,694 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Turning Kubernetes Events into spans

kspan - Turning Kubernetes Events into spans

This project is a Work In Progress, under active evolution.

Most Kubernetes components produce Events when something interesting happens. This program turns those Events into OpenTelemetry Spans, joining them up by causality and grouping them together into Traces.

Example: rollout of a Deployment of two Pods:

image

The picture was generated by kspan and Jaeger; it is a visualisation of the events generated from kubectl apply. kspan has identified five different sources of events, and has joined up the events for starting each Pod underneath the ReplicaSet scaling operation that created it.

We start with this concrete information:

  • Each Event has an Involved Object, e.g. when Kubelet sends a "Started" event, the Involved Object is a Pod.
  • Every Kubernetes object can have one or more Owner References. So for instance we can walk from the Pod up to a Deployment that caused it to be created.

Complications:

  • We cannot expect events to arrive in the ideal order; we need to delay handling some until their "parent" arrives to make sense.

Heuristics:

  • If we recently saw an event from an owner, that probably caused this event in the owned object. We set the child-of relationship on the new span.
  • A couple of specific events, from ReplicationSet and StatefulSet, are reported on the owner but make more sense as events on the sub-object they mention.
  • An event can be marked in its annotations as the start of a trace.
  • If we have walked the owner chain up to an object with no owner, no recent event, then start a new trace.
    • Trace ID is hashed from UID of this object + its generation

For future consideration:

  • We can match up resourceVersion between event and object.
    • do we need to?

To run Jaeger locally:

docker run -d --name jaeger -p 16686:16686 -p 55680:55680 jaegertracing/opentelemetry-all-in-one

Join in the fun!

If you have any questions about, or feedback on kspan:

Your feedback is always welcome!

More Repositories

1

loki

Loki: Simple, Distributed Tracing
Go
125
star
2

flux-classic

Microservice routing
Go
82
star
3

docker-plugin

Deprecated, part of Weave Net now
Makefile
33
star
4

weave-kube

Deprecated, part of Weave Net now
32
star
5

consul-sidekick

Automatic peer management for Consul in Kubernetes
Go
22
star
6

discovery

Weave Net peer discovery
Shell
15
star
7

scope-global-swarm-service

Running Weave Scope as a Global Swarm Service
13
star
8

demo-weave-kube-hybrid

Weave + Kubernetes Federation across cloud providers
HCL
13
star
9

fleeet

Go
5
star
10

kubelet-mesh

🎂🎂🎂 We've enabled the most impressive UX for Kubernetes 🎂🎂🎂
Go
4
star
11

deployer

Experimental auto-deployer in Rust
Shell
3
star
12

scope-swarm-launcher

Weave Cloud Scope installer for Docker Swarm
Dockerfile
3
star
13

p-weave

PCF Weave Cloud Tile (for Scope & Prometheus currently)
Shell
3
star
14

weave-npc

Deprecated, part of Weave Net now
3
star
15

gitops-appmesh-eks

A progressive delivery GitOps pipeline powered by Weave Cloud and AWS App Mesh
3
star
16

weave-gitops-gpt

2
star
17

istio-demo

Weave Cloud Istio Flagger demo
2
star
18

kube-prom-check

Lint Prometheus configurations in Kubernetes ConfigMaps
Haskell
1
star
19

shell-image

A Docker image that lets you say `docker run -ti shell`
1
star
20

wlw

Prometheus demo app - who lives where?
Go
1
star
21

docker2kube

Go from a Docker image for a program that runs on a port to the simplest possible Kubernetes config for that program
Go
1
star
22

fluxctl-rollout

A tool for controlling rollouts using Istio-enabled clusters, works well with Flux for GitOps (could become embedded into Flux one day)
Python
1
star
23

weave-cni

Deprecated, part of Weave Net now
Go
1
star