weaveworks-experiments / kspan

Turning Kubernetes Events into spans
Apache License 2.0
788 stars 56 forks source link

WIP Create a top-level span for events which have no actor #13

Closed vrutkovs closed 3 years ago

vrutkovs commented 3 years ago

If no actor can be found for the event, set it to object itself. This would ensure events created by operators (i.e. new pods) can be traced properly. In order to structure this correctly actor == object in objRef and this case takes precendence over ownership check.

This also updates createTraceFromTopLevelObject:

Not entirely sure how to reproduce this - in Openshift this can be reproduced by using oc debug node/ which creates a priviledged pod on the node. I think any kubectl create pod would replicate this behaviour.

Before: Screenshot_2021-03-26 Jaeger UI

After: Screenshot_2021-03-26 Jaeger UI(2)

vrutkovs commented 3 years ago

Marking as WIP as it fails existing tests

bboreham commented 3 years ago

Interesting thought, thanks. It is a bit of a problem dealing with a "big bag of heuristics" that you tweak one thing and another thing breaks.

Do you think you could add a test (source events and expected output) for the new behaviour you are adding?

vrutkovs commented 3 years ago

Do you think you could add a test (source events and expected output) for the new behaviour you are adding?

yup, will do

thundering-herd commented 3 years ago

@vrutkovs is this PR still active?

vrutkovs commented 3 years ago

Sorry, this needed quite a few changes in events we emit, so I dropped this.

Feel free to pick up of course