unixSocketEndpoint converts the unix scheme from URL to an OTEL endpoint that can be used with the OTLP exporter. The OTLP exporter handles unix sockets in a strange way. It seems to imply they can be used as an environment variable and are handled properly, but they don't seem to be as the behavio
(u *url.URL)
| 143 | // while the underlying implementation needs the scheme to use the |
| 144 | // correct resolver. |
| 145 | func unixSocketEndpoint(u *url.URL) string { |
| 146 | // GRPC does not allow host to be used. |
| 147 | socketPath := u.Path |
| 148 | |
| 149 | // If we are on windows and we have an absolute path |
| 150 | // that references a letter drive, check to see if the |
| 151 | // WSL equivalent path exists and we should use that instead. |
| 152 | if isWsl() { |
| 153 | if p := wslSocketPath(socketPath, os.DirFS("/")); p != "" { |
| 154 | socketPath = p |
| 155 | } |
| 156 | } |
| 157 | // Enforce that we are using forward slashes. |
| 158 | return "unix://" + filepath.ToSlash(socketPath) |
| 159 | } |
| 160 | |
| 161 | // wslSocketPath will convert the referenced URL to a WSL-compatible |
| 162 | // path and check if that path exists. If the path exists, it will |
no test coverage detected
searching dependent graphs…