Skip to content
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

Merged
merged 4 commits into from
Oct 7, 2022

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Oct 7, 2022

See commits for details.

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>
@rolinh rolinh changed the title flow: add support for trace context flow: add support for trace context, drop support for Go 1.17 Oct 7, 2022
// 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 {
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@chancez chancez left a 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.

@rolinh rolinh merged commit f8f33a0 into master Oct 7, 2022
@rolinh rolinh deleted the pr/rolinh/trace-context branch October 7, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants