You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today the receiver config requires platform-specific fields to specify
the listen path: 'pipe' on Windows (a named pipe path) and 'socket'
on Unix (a Unix domain socket path). This means configs that use
environment variable substitution via the ${env:VAR} syntax cannot
use a single property that works across both platforms, since the
field name itself is platform-specific.
Add a new 'target' field that acts as a platform-agnostic alternative.
During Validate(), when 'target' is set, its value is copied into the
appropriate platform-specific field: NamedPipePath on Windows and
UnixSocketPath on Unix. The existing normalization logic then handles
the value as usual, including named pipe prefix expansion on Windows
and af_unix: prefix stripping on Unix.
Example usage:
```yaml
receivers:
trace2receiver:
target: ${env:TRACE2_TARGET}
```
Unix:
```
TRACE2_TARGET=af_unix:/var/trace2.socket ./otel --config config.yaml
```
Windows:
```
SET TRACE2_TARGET //./pipe/trace2
otel --config config.yaml
```
It is an error to specify both 'target' and the platform-specific
field ('pipe' or 'socket'), since the intent would be ambiguous.
Add tests covering the target-to-socket mapping on Unix (with and
without af_unix: prefix), the target-to-pipe mapping on Windows,
and the conflict error for both platforms.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
0 commit comments