-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synthesise Events from Condition transitions #2
Open
bboreham
wants to merge
4
commits into
main
Choose a base branch
from
conditions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bboreham
force-pushed
the
conditions
branch
3 times, most recently
from
April 15, 2021 12:30
0ba4d5d
to
9d2c440
Compare
bboreham
force-pushed
the
conditions
branch
2 times, most recently
from
May 18, 2021 15:56
7b3b275
to
7eff97a
Compare
This gives a much richer trace output, showing how objects get initialized. We have to do a 'watch' on every object to see Conditions change over time. We watch everything in the owner chain, to pick up changes at every level. We adjust timestamps from condition transitions that have arrived promptly, the same as we do for Events, to give a more fine-grained display in tracing. Note the "Events" that are synthesised are just used as a convenient internal object to turn into spans; they aren't meant to look like real Events. For instance the ObjectMeta is populated with info useful for debugging.
Move capturing the initial state to the watcher, since it knows which objects are new. (Capture/playback is used for unit tests)
Note it is using captured data from a different date.
bboreham
changed the title
WIP: synthesise Events from Condition transitions
Synthesise Events from Condition transitions
May 19, 2021
Is my understanding correct that this just adds a new "data-source" to create spans from? |
Conceptually, yes. In some ways it should be better than Events, since we could get a better start/end timestamp. But in practice it seems we don’t always get each update, so we see a condition reset without seeing it set. It’s unmerged since it never quite worked right. |
rajatvig
added a commit
to rajatvig/kspan
that referenced
this pull request
Dec 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many objects have Conditions, like these on a Deployment:
We can create additional spans from the time these conditions are updated. Current code in this PR just creates zero-length spans same as we get with Events, but even better if we could put the start and end time of the span at the points where the transition goes to False then to True.
It works by starting a
Watch()
on any object we received an Event from, or anything in its owner chain, to see Conditions change over time.Still to do: drop the watch on objects that haven't done anything in a while.
We adjust timestamps from condition transitions that have arrived promptly, the same as we do for Events, to give a more fine-grained display in tracing.
Note the "Events" that are synthesised are just used as a convenient internal object to turn into spans; they aren't meant to look like real Events. For instance the ObjectMeta is populated with info useful for debugging.
The unit test for this feature builds on the capture/playback mechanism added in #32.
Example, from Cluster-API: