-
Notifications
You must be signed in to change notification settings - Fork 4
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
flow: add support for trace context, drop support for Go 1.17 #31
Conversation
115c43b
to
2727973
Compare
The upcoming version of Cilium uses the net/netip package which was added to Go 1.18. This means that older versions of Go are not supported anymore. Also, since Go 1.19 is out, Go 1.17 is EOL. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Updating Cilium means pulling latest API changes that add trace context information to Hubble flows. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
By default, a flow contains a trace context with a probability of 0.1. In theory, we should tie trace context to L7 flows only but the library doesn't generate L7 flows (yet). Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
The WithDropReasonNonDropProbability drop reason option incorrectly set the probability to 1.0 for any provided value greater than 0. This is incorrect, the intent was to bound the provided value between 0 and 1. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
2727973
to
e510380
Compare
// fakeTraceID generates a fake trace ID. See the W3C Trace Context | ||
// specification for details: | ||
// https://www.w3.org/TR/trace-context/#trace-id | ||
func fakeTraceID() 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.
Any reason we don't just use an actual library to generate a traceID?
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 just thought it's not needed in this context (generating fake data). The trace ID is simply a 16-byte array where the only invalid value is all bytes as zero so something easy enough to generate. There are considerations to have when generating trace IDs for a "real" use-case (see this document) but I don't think it applies here.
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.
Comment is non-blocking. LGTM.
See commits for details.