interp: add CommandObserver option for per-command observation#187
Closed
interp: add CommandObserver option for per-command observation#187
Conversation
Exposes CommandObserverFunc invoked once per simple command dispatch with name, args, exit code, status (ok/not_allowed/unknown), position, and duration. Intended for trace/telemetry instrumentation from embedders such as the Datadog Agent's Private Action Runner.
Collaborator
Author
|
Closing in favor of @julesmcrt's #186 which covers this and more (pipeline/for/if structural spans, self-contained tracer to org2). We opened these in parallel 5 hours apart — didn't spot his until afterwards. Will rebase our Agent-side trace-context-bridging PR (datadog-agent#49482) onto #186 once it lands and v0.0.12 ships. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a new public
CommandObserverRunnerOption that fires once per simple command dispatch, exposing the resolved command name, args, exit code, status, source position, and duration.Motivated by internal telemetry work in the Datadog Agent's Private Action Runner (design doc): the Agent needs to emit one APM span per rshell command so Datadog engineers can see which builtins customers actually use, which they try but aren't implemented, and which the allowlist blocks.
API
Wired into the single dispatch point at
interp/runner_exec.go:call, so it fires for every path (builtin execution, allowlist rejection, unknown command).Follow-up
Tag v0.0.11 after merge so the datadog-agent can bump.