Problem
I noticed this while working on the --debug flag fix (#499) and reading through the match pipeline.
When instrumentation rules match nothing, otelc completes successfully with no user-visible feedback. This results in an uninstrumented binary without any indication that rules were ineffective.
Reproduction
- Create a rule with an incorrect target (e.g. typo in package path —
net/htp instead of net/http)
- Run:
otelc --rules broken.yaml go build -o app .
Observed behavior
- Exit code 0
- No output on stdout/stderr
.otelc-build/matched.json contains []
debug.log shows "Found available rules" → "Stored matched sets" with no indication that zero matches occurred
Even in debug mode, a zero-match outcome is only observable by the absence of "Match ..." log lines.
Expected behavior
Users should receive an explicit warning when no rules match, since this commonly indicates misconfiguration (typos, version mismatches, renamed functions, outdated targets).
Proposal
Emit a warning to stderr when matchDeps returns empty, e.g.:
0 rules matched — no instrumentation will be applied.
This is a small, low-risk change that provides immediate feedback to users. Happy to open a PR.
This could also open the door to something like otelc list down the line, a read-only command to preview what rules match without building, but that's a separate discussion.
Problem
I noticed this while working on the
--debugflag fix (#499) and reading through the match pipeline.When instrumentation rules match nothing,
otelccompletes successfully with no user-visible feedback. This results in an uninstrumented binary without any indication that rules were ineffective.Reproduction
net/htpinstead ofnet/http)otelc --rules broken.yaml go build -o app .Observed behavior
.otelc-build/matched.jsoncontains[]debug.logshows"Found available rules"→"Stored matched sets"with no indication that zero matches occurredEven in debug mode, a zero-match outcome is only observable by the absence of
"Match ..."log lines.Expected behavior
Users should receive an explicit warning when no rules match, since this commonly indicates misconfiguration (typos, version mismatches, renamed functions, outdated targets).
Proposal
Emit a warning to stderr when
matchDepsreturns empty, e.g.:0 rules matched — no instrumentation will be applied.
This is a small, low-risk change that provides immediate feedback to users. Happy to open a PR.
This could also open the door to something like otelc list down the line, a read-only command to preview what rules match without building, but that's a separate discussion.