Skip to content

Commit 9f6298b

Browse files
committed
Standardize on INSTANA_AGENT_HOST; Deprecate *_IP
1 parent a3ea638 commit 9f6298b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The sensor tries to communicate with the Instana agent via IP 127.0.0.1 and as a
77
To use these, these environment variables should be set in the environment of the running Python process.
88

99
```shell
10-
export INSTANA_AGENT_IP = '127.0.0.1'
10+
export INSTANA_AGENT_HOST = '127.0.0.1'
1111
export INSTANA_AGENT_PORT = '42699'
1212
```
1313

instana/fsm.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@ def lookup_agent_host(self, e):
7070
host = a.AGENT_DEFAULT_HOST
7171
port = a.AGENT_DEFAULT_PORT
7272

73-
if "INSTANA_AGENT_IP" in os.environ:
73+
if "INSTANA_AGENT_HOST" in os.environ:
74+
host = os.environ["INSTANA_AGENT_HOST"]
75+
if "INSTANA_AGENT_PORT" in os.environ:
76+
port = int(os.environ["INSTANA_AGENT_PORT"])
77+
78+
elif "INSTANA_AGENT_IP" in os.environ:
79+
# Deprecated: INSTANA_AGENT_IP environment variable
80+
# To be removed in a future version
7481
host = os.environ["INSTANA_AGENT_IP"]
7582
if "INSTANA_AGENT_PORT" in os.environ:
7683
port = int(os.environ["INSTANA_AGENT_PORT"])

instana/options.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ def __init__(self, **kwds):
1616
self.log_level = logging.DEBUG
1717

1818
if "INSTANA_AGENT_IP" in os.environ:
19+
# Deprecated: INSTANA_AGENT_IP environment variable
20+
# To be removed in a future version
1921
self.agent_host = os.environ["INSTANA_AGENT_IP"]
2022

23+
if "INSTANA_AGENT_HOST" in os.environ:
24+
self.agent_host = os.environ["INSTANA_AGENT_HOST"]
25+
2126
if "INSTANA_AGENT_PORT" in os.environ:
2227
self.agent_port = os.environ["INSTANA_AGENT_PORT"]
2328

0 commit comments

Comments
 (0)