Describe the bug
Building a project that depends on an older google.golang.org/grpc version than the one used by pkg/instrumentation/grpc can fail during instrumentation.
otelc setup initially matches rules against the user's current dependency graph. Later, after instrumentation dependencies are added and go mod tidy runs, the dependency graph may change (for example grpc being bumped).
However, the previously matched rules are still stored using source file paths from the old dependency graph. During instrumentation, this causes stale file paths to be used against newer compile targets and results in build failures.
Environment
- OS: Fedora Linux
- Go Version: 1.25.9
- Version: main
To Reproduce
Steps to reproduce the behavior:
- Create a project using
google.golang.org/grpc older than v1.80.0 (version from pkg/instrumentation/grpc)
- Run
otelc go build
- Build will fail
Expected behavior
Instrumentation should refresh dependency matching after syncing instrumentation dependencies so matched source file paths always correspond to the final resolved dependency graph.
Additional context
This happens because pkg/instrumentation/grpc introduces newer grpc dep during setup, causing go mod tidy to update the dependency graph after rule matching has already completed.
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe the bug
Building a project that depends on an older
google.golang.org/grpcversion than the one used bypkg/instrumentation/grpccan fail during instrumentation.otelcsetup initially matches rules against the user's current dependency graph. Later, after instrumentation dependencies are added and go mod tidy runs, the dependency graph may change (for example grpc being bumped).However, the previously matched rules are still stored using source file paths from the old dependency graph. During instrumentation, this causes stale file paths to be used against newer compile targets and results in build failures.
Environment
To Reproduce
Steps to reproduce the behavior:
google.golang.org/grpcolder than v1.80.0 (version from pkg/instrumentation/grpc)otelc go buildExpected behavior
Instrumentation should refresh dependency matching after syncing instrumentation dependencies so matched source file paths always correspond to the final resolved dependency graph.
Additional context
This happens because
pkg/instrumentation/grpcintroduces newer grpc dep during setup, causinggo mod tidyto update the dependency graph after rule matching has already completed.Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.