fix(instrumentation): instrument command execution#39654
Merged
jamietanna merged 1 commit intomainfrom Dec 23, 2025
Merged
Conversation
01b5f81 to
4abf154
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4abf154 to
60e6e9c
Compare
Contributor
Author
|
Thoughts on how to get that coverage up? |
viceice
reviewed
Dec 12, 2025
95cced8 to
24b6fd4
Compare
Collaborator
RahulGautamSingh
left a comment
There was a problem hiding this comment.
LGTM. Not sure how to go about the tests :)
viceice
previously approved these changes
Dec 17, 2025
Member
viceice
left a comment
There was a problem hiding this comment.
you can mock the instrument function to simply call the callback in tests
12 tasks
5228e7b to
561f1e1
Compare
Contributor
Author
viceice
reviewed
Dec 23, 2025
As part of ongoing work to improve OpenTelemetry instrumentation of Renovate in #38609, we can introduce an instrumented call for each external command execution. This makes sure we cover the key functions used for command execution - `rawExec` - across the codebase, which is used under-the-hood by `exec`. Because commands could include sensitive arguments (such as repo or global secrets) we need to make sure we sanitize the span name. Note that we don't add instrumentation to `tools/utils/exec.ts` as it's only used for i.e. building the docs site, and isn't used as part of the core Renovate CLI.
561f1e1 to
22adcee
Compare
viceice
approved these changes
Dec 23, 2025
Contributor
|
🎉 This PR is included in version 42.66.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
secustor
reviewed
Dec 23, 2025
| opts: RawExecOptions, | ||
| ) => Promise<ExecResult> = exec; | ||
| ) => Promise<ExecResult> = (cmd: string, opts: RawExecOptions) => | ||
| instrument(`rawExec: ${sanitize(cmd)}`, () => exec(cmd, opts)); |
Member
There was a problem hiding this comment.
There is a specification for it https://opentelemetry.io/docs/specs/semconv/cli/cli-spans/
Contributor
Author
There was a problem hiding this comment.
Of course, I should've guessed! Raised #40129 for this :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes
As part of ongoing work to improve OpenTelemetry instrumentation of
Renovate in #38609, we can introduce an instrumented call for each
external command execution.
This makes sure we cover the key functions used for command
execution -
rawExec- across the codebase, which is usedunder-the-hood by
exec.Because commands could include sensitive arguments (such as repo or
global secrets) we need to make sure we sanitize the span name.
Note that we don't add instrumentation to
tools/utils/exec.tsas it'sonly used for i.e. building the docs site, and isn't used as part of the
core Renovate CLI.
Context
Please select one of the below:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: https://github.com/JamieTanna-Mend-testing/backstage
When using: