Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
emmettbutler committed Jan 23, 2024
1 parent 1a4719f commit 56e55e6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class HttpClientRequestReturn(BaseModel):

@app.post("/http/client/request")
def http_client_request(args: HttpClientRequestArgs) -> HttpClientRequestReturn:
"""Creates and finishes a span similar to the ones created during HTTP request/response cycles"""
# falcon config doesn't really matter here - any config object with http header tracing enabled will work
integration_config = config.falcon
request_headers = {k: v for k, v in args.headers}
Expand All @@ -258,6 +259,8 @@ def http_client_request(args: HttpClientRequestArgs) -> HttpClientRequestReturn:
request_span, integration_config, request_headers=request_headers, response_headers=response_headers
)
spans[request_span.span_id] = request_span
# this cache invalidation happens in most web frameworks as a side effect of their multithread design
# it's made explicit here to allow test expectations to be precise
config.http._reset()
config._header_tag_name.invalidate()
return HttpClientRequestReturn()
Expand Down

0 comments on commit 56e55e6

Please sign in to comment.