This adds methods to allow us to save and restore spans using ZooKeeper data. Additionally, we subclass the tracing.Span class so that we can transparently handle timestamps which are stored as floating point numbers rather than integer nanoseconds. To exercise the new features, emit spans for QueueItems and BuildSets. Because most of our higher-level (parent) spans may start on one host and end on another, we save the full information about the span in ZK and restore it whenever we do anything with it, including starting child spans. This works well for starting a Build span given a BuildSet, since both objects are used by the executor client and so the span information for both is available. However, there are cases where we would like to have child spans and we do not have the full information of the parent, such as any children of the Build span on the executor. We could duplicate all the information of the Build span in ZK and send it along with the build request, but we really only need a few bits of info to start a remote child span. In OpenTelemetry, this is called trace propogation, and there are some tools for this which assume that the implicit trace context is being used and formats information for an HTTP header. We could use those methods, but this change adds a simpler API that is well suited to our typical json-serialization method of propogation. To use it, we will add a small extra dictionary to build and merge requests. This should serialize to about 104 bytes. So that we can transparantly handle upgrades from having no saved state for spans and span context in our ZK data, have our tracing API return a NonRecordingSpan when we try to restore from a None value. This code uses tracing.INVALID_SPAN or tracing.INVALID_SPAN_CONTEXT which are suitable constants. They are sufficiently real for the purpose of context managers, etc. The only down side is that any child spans of these will be real, actual reported spans, so in these cases, we will emit what we intend to be child spans as actual parent traces. Since this should only happen when a user first enables tracing on an already existing system, that seems like a reasonable trade-off. As new objects are populated, the spans will be emitted as expected. The trade off here is that our operational code can be much simpler as we can avoid null value checks and any confusion regarding context managers. In particular, we can just assume that tracing spans and contexts are always valid. Change-Id: If55b06572b5e95f8c21611b2a3c23f7fd224a547
Zuul
Zuul is a project gating system.
The latest documentation for Zuul v3 is published at: https://zuul-ci.org/docs/zuul/
If you are looking for the Edge routing service named Zuul that is related to Netflix, it can be found here: https://github.com/Netflix/zuul
If you are looking for the Javascript testing tool named Zuul, it can be found here: https://github.com/defunctzombie/zuul
Getting Help
There are two Zuul-related mailing lists:
- zuul-announce
-
A low-traffic announcement-only list to which every Zuul operator or power-user should subscribe.
- zuul-discuss
-
General discussion about Zuul, including questions about how to use it, and future development.
You will also find Zuul developers in the #zuul channel on Freenode IRC.
Contributing
To browse the latest code, see: https://opendev.org/zuul/zuul To clone the latest code, use git clone https://opendev.org/zuul/zuul
Bugs are handled at: https://storyboard.openstack.org/#!/project/zuul/zuul
Suspected security vulnerabilities are most appreciated if first reported privately following any of the supported mechanisms described at https://zuul-ci.org/docs/zuul/user/vulnerabilities.html
Code reviews are handled by gerrit at https://review.opendev.org
After creating a Gerrit account, use git review to submit patches. Example:
# Do your commits
$ git review
# Enter your username if prompted
Join #zuul on Freenode to discuss development or usage.
License
Zuul is free software. Most of Zuul is licensed under the Apache License, version 2.0. Some parts of Zuul are licensed under the General Public License, version 3.0. Please see the license headers at the tops of individual source files.
Python Version Support
Zuul requires Python 3. It does not support Python 2.
Since Zuul uses Ansible to drive CI jobs, Zuul can run tests anywhere Ansible can, including Python 2 environments.