Skip to content

Commit 6474bc6

Browse files
committed
Have Options respect any standard env vars that are set.
1 parent a975f7f commit 6474bc6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

instana/options.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ class Options(object):
99
log_level = logging.WARN
1010

1111
def __init__(self, **kwds):
12+
""" Initialize Options
13+
Respect any environment variables that may be set.
14+
"""
1215
if "INSTANA_DEV" in os.environ:
1316
self.log_level = logging.DEBUG
1417

18+
if "INSTANA_AGENT_IP" in os.environ:
19+
self.agent_host = os.environ["INSTANA_AGENT_IP"]
20+
21+
if "INSTANA_AGENT_PORT" in os.environ:
22+
self.agent_port = os.environ["INSTANA_AGENT_PORT"]
23+
1524
self.__dict__.update(kwds)

0 commit comments

Comments
 (0)