commit | 8cad58b3fcbb3ae3578ecc72f5eed440de8a3715 | [log] [tgz] |
---|---|---|
author | Michael Matloob <matloob@golang.org> | Tue Jun 11 17:15:26 2024 -0400 |
committer | Michael Matloob <matloob@golang.org> | Wed Jun 12 19:18:26 2024 +0000 |
tree | a57f7bd12a585dbf4283064b63dd91ab57a625fb | |
parent | 221703e18637934f3b2a12fa8df1fa96a70fa887 [diff] |
telemetry: add MaybeChild, which executes child logic if applicable In the Go command, we can't call telemetry.Start as the first thing when the Go command starts because we can't do significant work before doing toolchain switching. On the other hand, we do want to run the child logic if the Go command is running as the telemetry child as the first thing before doing toolchain selection: the parent has already been started using the switched toolchain. Add a telemetry.MaybeChild function that executes the child code if the go command is running as the child that will be called immediately when the go command starts. Start will continue to check if it's the child for now to avoid breaking current usages of it but we might want to remove that code from Start in the future to make things a bit simpler. The initialization of the parent/child process that was done by start has now been moved into parent and child. There is limited duplication (for example, initializing the telemetry directory) but much of the work is different between them. For instance, we don't need to check the mode in the child function because it was already checked by the parent before starting the child. One unfortunate consequence of doing this is that the manipulation and checking of the GO_TELEMETRY_CHILD environment variable now happens in four places (EntryPoint, Start, parent, and startChild) rather than two previously (Start and parent) Change-Id: I3d31e44ee3a141b08ffd87f037f1a03f0513c1cc Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/592017 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This repository holds the Go Telemetry server code and libraries, used for hosting telemetry.go.dev and instrumenting Go toolchain programs with opt-in telemetry.
Warning: this repository is intended for use only in tools maintained by the Go team, including tools in the Go distribution and auxiliary tools like gopls or govulncheck. There are no compatibility guarantees for any of the packages here: public APIs will change in breaking ways as the telemetry integration is refined.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/telemetry:” in the subject line, so it is easy to find.
This repository uses eslint to format TS files, stylelint to format CSS files, and prettier to format TS, CSS, Markdown, and YAML files.
See the style guides:
It is encouraged that all TS and CSS code be run through formatters before submitting a change. However, it is not a strict requirement enforced by CI.
./npm install
./npm run all