zalando-zmon / opentracing-utils

Convenient utilities for adding OpenTracing support in your python projects
MIT License
20 stars 8 forks source link

Support ignore patterns for requests library #15

Closed mvalkon closed 6 years ago

mvalkon commented 6 years ago

In some cases the user might want to avoid tracing of specific URL's or endpoints. This commit adds a new parameter to the trace_requests()-function to set a list of URL patterns to ignore when a request is made. ignore_patterns is a keyword argument and should contain python regex patterns that can be used for matching. For example, ignore tracing requests to a sidecar container running in localhost:4040:

trace_requests(ignore_patterns=[r".*localhost:4040"])
codecov[bot] commented 6 years ago

Codecov Report

Merging #15 into master will increase coverage by 0.03%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage    97.9%   97.94%   +0.03%     
==========================================
  Files           7        7              
  Lines         239      243       +4     
==========================================
+ Hits          234      238       +4     
  Misses          5        5
Impacted Files Coverage Δ
opentracing_utils/libs/_requests.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 271fc5b...b51b1c0. Read the comment docs.

mohabusama commented 6 years ago

👍

mvalkon commented 6 years ago

👍