Open zheng199512 opened 3 years ago
I see what you're saying, but that implies a tremendous amount of understanding about what each event means. I doubt if kspan will get that knowledge hard-coded in Go. Maybe as some "rules base"?
However it may also be possible to do it by matching up resourceVersion
between the events and objects.
Can you capture that detail for your example and see if that works?
matching up resourceVersion between the events and objects.
, i'm confused whether it's useful for the span data.
@xuchen-xiaoying do you have a specific question or suggestion?
@xuchen-xiaoying do you have a specific question or suggestion?
just wonder if we can match up resourceVersion between the events and objects, how will we organize spans based on the relationshipi?
Here is the definition of Event
:
https://github.com/kubernetes/kubernetes/blob/5b1e5387591dd3ad0b3ddacc9e44a6ac7260078e/staging/src/k8s.io/api/core/v1/types.go#L5661-L5668
type Event struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
// The object that this event is about.
InvolvedObject ObjectReference `json:"involvedObject" protobuf:"bytes,2,opt,name=involvedObject"`
InvolvedObject
has a field ResourceVersion
. "resourceVersion is changed by the server every time an object is modified." from docs.
This field, if supplied, will match the object it refers to at a point in time. This may let you see whether a Deployment was being scaled up or down at the time.
However I would stress that my suggestion was to do some analysis to find out if this works. I am not stating it will definitely work.
Here is the definition of
Event
: https://github.com/kubernetes/kubernetes/blob/5b1e5387591dd3ad0b3ddacc9e44a6ac7260078e/staging/src/k8s.io/api/core/v1/types.go#L5661-L5668type Event struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` // The object that this event is about. InvolvedObject ObjectReference `json:"involvedObject" protobuf:"bytes,2,opt,name=involvedObject"`
InvolvedObject
has a fieldResourceVersion
. "resourceVersion is changed by the server every time an object is modified." from docs.This field, if supplied, will match the object it refers to at a point in time. This may let you see whether a Deployment was being scaled up or down at the time.
However I would stress that my suggestion was to do some analysis to find out if this works. I am not stating it will definitely work.
I got it. Really appreciate your explanation.
Here, I think it is necessary to judge the deployment scale up or down, otherwise it may cause incorrect parent relationship