-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new CallContext APIs #17
Merged
Merged
Conversation
This file contains 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
y1yang0
force-pushed
the
yyang/callcontext_api
branch
from
July 29, 2024 08:47
29aa830
to
c64cb0e
Compare
123liuziming
approved these changes
Jul 29, 2024
y1yang0
added a commit
that referenced
this pull request
Jul 30, 2024
* feat: new CallContext APIs * fix TestGoMongo111 * consolidate dst node replication
y1yang0
added a commit
that referenced
this pull request
Jul 30, 2024
* feat: new CallContext APIs * fix TestGoMongo111 * consolidate dst node replication
y1yang0
added a commit
that referenced
this pull request
Jul 30, 2024
* feat: new CallContext APIs * fix TestGoMongo111 * consolidate dst node replication
y1yang0
added a commit
that referenced
this pull request
Aug 1, 2024
y1yang0
added a commit
that referenced
this pull request
Aug 9, 2024
123liuziming
added a commit
that referenced
this pull request
Aug 9, 2024
* Test/ut (#21) add more tests! * chore: move rp.writeTrampoline into proper file (#18) * fix: otel_setup_inst.go executes after RawFunc causing HookFunc to be nil resulting in panic (#22) * docs: update how-it-works.md * ci: add test for dynamic CallContext APIs generation (#17) * docs: update README.md (#18) * refine: simplify insertAtBody (#18) * refine: check GO111MODULE env * feat: support mysql and refactor test framework (#29) * feat: support mysql and refactor test framework * feat: fix test * feat: fix test * test: add test for database/sql * test: skip nil test * fix: SetParam panics if argument is nil (#31) * feat: support redisv9 (#30) * feat: support redisv9 * feat: add test for redis * feat: fix muzzle * Update integration_test.go * feat/nethttp (#26) * add test for instrumenter package * add test in cicd * add test in cicd * fix test * improve test coverage * add more test * feat: nethttp and gls * fix mongo test * fix http_attrs_extractor_test.go * fix compile error * add test for net http * fix test * add example * go mod tidy --------- Co-authored-by: Yi Yang <[email protected]>
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.
Currently, if we want to change the parameters or return values of the original function, we are using a very error-prone and meticulously written code:
opentelemetry-go-auto-instrumentation/pkg/rules/test/fmt_hook.go
Lines 19 to 22 in 61d3c18
This troubles rule authors and is highly prone to errors. We should consider providing APIs in the CallContext to allow rule authors to easily modify parameters or return values without needing to understand the "pointer to a pointer is the original value" magic. For example:
This patch significantly changes the form of the hook code; specifically,
CallContext
is no longer a struct but an interface. The reason for this change is that we might be instrumenting different methods within the same package, and we need to generate the get/setParam functions at compile time. The parameter types of different methods are different, so we need to dynamically generate different struct implementations for different methods.related to #4