kspan icon indicating copy to clipboard operation
kspan copied to clipboard

judge the deployment scale up or down,otherwise it may cause incorrect parent relationship

Open zheng199512 opened this issue 4 years ago • 6 comments

Here, I think it is necessary to judge the deployment scale up or down, otherwise it may cause incorrect parent relationship

image

zheng199512 avatar Jul 16 '21 03:07 zheng199512

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?

bboreham avatar Aug 03 '21 13:08 bboreham

matching up resourceVersion between the events and objects. , i'm confused whether it's useful for the span data.

xuchen-xiaoying avatar Feb 25 '22 09:02 xuchen-xiaoying

@xuchen-xiaoying do you have a specific question or suggestion?

bboreham avatar Feb 25 '22 11:02 bboreham

@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?

xuchen-xiaoying avatar Feb 28 '22 07:02 xuchen-xiaoying

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.

bboreham avatar Feb 28 '22 11:02 bboreham

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.

I got it. Really appreciate your explanation.

xuchen-xiaoying avatar Mar 01 '22 05:03 xuchen-xiaoying