| ... | @@ -285,10 +285,14 @@ function finalizeRunProcess<R>( | ... | @@ -285,10 +285,14 @@ function finalizeRunProcess<R>( |
| 285 | ); | 285 | ); |
| 286 | } | 286 | } |
| 287 | | 287 | |
| | 288 | /** The executable name without its directory, recorded as `process.command` on process spans. */ |
| | 289 | export const commandName = (command: string) => command.replace(/^.*[\\/]/, ""); |
| | 290 | |
| 288 | const runProcessCore = Effect.fn("processRunner.runProcessCore")(function* ( | 291 | const runProcessCore = Effect.fn("processRunner.runProcessCore")(function* ( |
| 289 | spawner: ChildProcessSpawner.ChildProcessSpawner["Service"], | 292 | spawner: ChildProcessSpawner.ChildProcessSpawner["Service"], |
| 290 | input: ProcessRunInput, | 293 | input: ProcessRunInput, |
| 291 | ): Effect.fn.Return<ProcessRunOutput, ProcessRunError, Scope.Scope> { | 294 | ): Effect.fn.Return<ProcessRunOutput, ProcessRunError, Scope.Scope> { |
| | 295 | yield* Effect.annotateCurrentSpan("process.command", commandName(input.command)); |
| 292 | const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES; | 296 | const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES; |
| 293 | const outputMode = input.outputMode ?? "error"; | 297 | const outputMode = input.outputMode ?? "error"; |
| 294 | const truncatedMarker = input.truncatedMarker ?? ""; | 298 | const truncatedMarker = input.truncatedMarker ?? ""; |