Introduces a TempDir helper class
This was done to help handle an oversight in the prior per-process temp dir change. The fallback mode is to use the shared java.io.tmpdir directly.
When using java.io.tmpdir, we don't want to be creating and destorying, since it may be shared.
The new TempDir object is constructed knowing whether the TempDir is per-process or shared -- and the behavior of its prepare and cleanup method change accordingly.
When using a per-process temp dir, the dir is creating and deleted regularly. When using a shared temp dir, those methods become nops.
Creating TempDir also made it easy to avoid repeatedly calling deleteOnExit in the event that delete fails, so I made that change as well.
Switching to create a per-process temp dir as protection against file name collisions. This is done by introduced TEMP_DIR which is calculated during class initialization.
The current selection process generates a random directory name and sees if that name is availabe in java.io.tmpdir. If it is that name is selected; otherwise, another name is generated.
If no unique name is found after 10 rounds of generation, the code falls back to the old behavior of writing directly to java.io.tmpdir.
Create helper methods injectBootstrapClassLoader & injectClassLoader.
The directory creation and retry logic that will be added to the handling of the bootstrap will complicated the code.
To keep the code readable, I broke the bootstrap handling into its own method. To keep the level abstraction consistent, I did the same with injectClassLoader.
This change adds a requestingName field to help in diagnosing the source of any injection failures.
Usually, the requestingName is the simple class name of the Instrumenter; however, this change doesn't propagate the Instumeneter named through FieldBackedProvider.
* Added service name and corrected span name
* Support peer address for clients
* Added server peer address resolution
* Added constants for new tag names
* Cosmetic change
* Fixed muzzle issue
* Better handling of addresses
* Addressed PR comments