Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Implement proxies for Azure exporters #101

Merged
merged 10 commits into from Jun 24, 2020
Merged

Implement proxies for Azure exporters #101

merged 10 commits into from Jun 24, 2020

Conversation

lzchen
Copy link
Contributor

@lzchen lzchen commented Jun 22, 2020

Add the ability to specify proxies that the request to Azure Monitor backend will pass through.

Users will pass in a string representing a dict format.

See requests for more details.

@lzchen lzchen requested a review from hectorhdzg as a code owner June 22, 2020 16:51
@lzchen lzchen changed the title proxies Implement proxies for Azure exporters Jun 22, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2020

Codecov Report

Merging #101 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #101      +/-   ##
==========================================
+ Coverage   92.71%   92.73%   +0.01%     
==========================================
  Files          21       21              
  Lines        1139     1142       +3     
  Branches      140      141       +1     
==========================================
+ Hits         1056     1059       +3     
  Misses         55       55              
  Partials       28       28              
Impacted Files Coverage Δ
azure_monitor/src/azure_monitor/export/__init__.py 100.00% <ø> (ø)
azure_monitor/src/azure_monitor/options.py 100.00% <100.00%> (ø)

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 b358a05...8966888. Read the comment docs.

@@ -49,6 +51,7 @@ def __init__(
self,
connection_string: str = None,
instrumentation_key: str = None,
proxies: typing.Dict[str, str] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe setting the default as {} instead of None to avoid check afterwards

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutable defaults are a common pitfall in Python. https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments

@lzchen lzchen merged commit e9e669f into microsoft:master Jun 24, 2020
@lzchen lzchen deleted the proxy branch June 24, 2020 20:34
@lzchen lzchen mentioned this pull request Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants