-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: net/http server-side instrumentation (#403)
Resolves #173, resolves #400 This PR changes `net/http` server-side instrumentation aspects to trace the library itself (similar approach as we are doing today with the client-side instrumentation). The hook where we inject is the `http.Server.Serve` method, which should be the common method that is always called when the http server is started (and at this point, the Handler should already be set). This fixes problems in the existing instrumentation where we: - Don't trace custom `http.Handler` implementations (#173). - We double-trace `http.HandlerFunc(func(w http.ResponseWriter, r *http.Request))` declarations. - We might even break the build (as described in #400). - Patterns using assignment like `srv.Handler = myHandler` are not traced. As a side-effect, this approach removes the ability to use `orchestrion:ignore` comments to skip tracing on http servers (which happens for other aspects as well where we instrument the library code). --------- Co-authored-by: Romain Marcadier <[email protected]> Co-authored-by: Romain Marcadier <[email protected]>
- Loading branch information
1 parent
657c57f
commit a8237ee
Showing
31 changed files
with
600 additions
and
545 deletions.
There are no files selected for viewing
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
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
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
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
4 changes: 2 additions & 2 deletions
4
_integration-tests/tests/mux/gen_test.go → ...ation-tests/tests/gorilla_mux/gen_test.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.