Skip to content

Commit

Permalink
chore: properly label net/http client aspects (#179)
Browse files Browse the repository at this point in the history
This will improve the rendering on the documentation site.
  • Loading branch information
RomainMuller authored Jul 24, 2024
1 parent f401175 commit e7cab8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/injector/builtin/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions internal/injector/builtin/yaml/stdlib/net-http.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ meta:
icon: at-symbol
aspects:
# Add tracing to the default http.RoundTripper implementation.
- join-point:
- id: Add field to Transport
join-point:
struct-definition: net/http.Transport
advice:
add-struct-field:
name: DD__tracer_internal
type: bool
# In tracer internals, set the DD__tracer_internal field to true so that we do not end up
# instrumenting the tracer's internal HTTP clients (this would be a span bomb!)
- tracer-internal: true
- id: Flag tracer internal Transport instances
tracer-internal: true
join-point:
all-of:
- struct-literal:
Expand All @@ -37,7 +39,8 @@ aspects:
{{ range .AST.Elts }}{{ . }},
{{ end }}
}
- join-point:
- id: Instrument Transport.RoundTrip
join-point:
function-body:
function:
- name: RoundTrip
Expand Down Expand Up @@ -157,7 +160,8 @@ aspects:
# Replace the http.Get, http.Head, http.Post, and http.PostForm short-hands with the longer forms if
# there is a context available from the surroundings.
- join-point:
- id: Wire context through http.Get/Head/Post/PostForm
join-point:
all-of:
- not:
# We don't want to instrument in net/http, it'd create a circular dependency!
Expand Down

0 comments on commit e7cab8b

Please sign in to comment.