Giter VIP home page Giter VIP logo

kspan's Introduction

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!

kspan's People

Contributors

bboreham avatar pavolloffay avatar puckpuck avatar yiannistri avatar david-vavra avatar vrutkovs avatar

Watchers

Rohan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.