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
hubble[/relay]: add version to observer.ServerStatus and add and implement observer.GetNodes #13979
Conversation
Will rework this PR to add a new |
f77e7e9
to
59c7b83
Compare
Changes implemented. This PR is now ready for review. |
59c7b83
to
c7f9f47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great patch, tested and it looks good! I have a couple of questions, and also would like to see a trivial test case for the codes.Unimplemented
returned by Hubble's GetNodes
.
751f0f8
to
ccaaaa9
Compare
test-me-please |
ccaaaa9
to
efaa764
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to blang/semver
LGTM, one remark regarding missing test tag (see GH action failure).
a8cef44
to
c7c6f5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working great, thanks!
Knowing about the running version is useful, notably during a cluster upgrade. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
This endpoint is intended to be implemented by Hubble Relay to provide information about nodes and their status. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
The new generated code breaks implementations of observer server because they are missing the new GetNodes method. To ensure that every commit compiles on its own, add stubs to implementations of observer server. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
c7c6f5d
to
ab09bb6
Compare
test-me-please |
retest-4.9 EDIT: bah, I meant to re-test runtime. 4.9 run was ✔️ |
retest-runtime This failure is a flake (completely unrelated to this PR), see #14149. |
retest-runtime |
retest-net-next |
// component is the Hubble component (eg: hubble, hubble-relay). | ||
component string | ||
// Core represents the core version (eg: 1.9.0). | ||
Core string | ||
// Revision is the software revision, typically a Git commit SHA. | ||
Revision string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is one unexported?
MaxFlows: s.GetRingBuffer().Cap(), | ||
NumFlows: s.GetRingBuffer().Len(), | ||
SeenFlows: atomic.LoadUint64(&s.numObservedFlows), | ||
UptimeNs: uint64(time.Since(s.startTime).Nanoseconds()), | ||
}, nil | ||
} | ||
|
||
// GetNodes implements observerpb.ObserverClient.GetNodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it implement it though :)
continue | ||
} | ||
n.State = relaypb.NodeState_NODE_CONNECTED | ||
p := p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would suggest to at least now shadow the name.
EDIT: after further digging through faqs it seems like shadow is the recommendation directly from Rob Pike. golang/go@0cab7d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rolinh perhaps would be good to add a comment to explain the motivation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@errordeveloper This is common practice and even recommended as the "easier" way of achieving this in the Go FAQ. I could add a comment here but then there are many places in the codebase that would need the same comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, if it's actually part of the FAQ, comment is unnecessary
Add version information to
observer.ServerStatus
.Additionally, add
observer.GetNodes
and implement it in Hubble Relay. This new endpoint provides a list of nodes with name, version, address and connection state and TLS information. This is mostly useful for Hubble UI to provide a list of all nodes with version and status on a status page but it could also be leveraged by Hubble CLI (eghubble nodes list
).For reference, this is the output I get when using
grpcurl
to issue anobserver.GetNodes
request against Hubble Relay on my 4 nodes dev cluster with one unavailable node:And for completeness, here is the version information in
observer.ServerStatus
:When querying a local hubble instance from a Cilium pod:
And for the status:
Closes: #13935