Skip to content

Commit b28b801

Browse files
committed
Switch to psutil and update announce
1 parent 30af3b6 commit b28b801

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

instana/fsm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import subprocess
22
import os
3-
import sys
3+
import psutil
44
import threading as t
55
import fysom as f
66
import instana.log as l
@@ -91,10 +91,10 @@ def check_host(self, host):
9191

9292
def announce_sensor(self, e):
9393
l.debug("announcing sensor to the agent")
94-
95-
d = Discovery(pid=os.getpid(),
96-
name=sys.executable,
97-
args=sys.argv[0:])
94+
p = psutil.Process(os.getpid())
95+
d = Discovery(pid=p.pid,
96+
name=p.cmdline()[0],
97+
args=p.cmdline()[1:])
9898

9999
(b, _) = self.agent.request_response(
100100
self.agent.make_url(a.AGENT_DISCOVERY_URL), "PUT", d)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ nose>=1.0
22
fysom>=2.1.2
33
opentracing>=1.2.1
44
basictracer>=2.2.0
5+
psutil>=5.1.3

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
setup_requires=['nose>=1.0',
1414
'fysom>=2.1.2',
1515
'opentracing>=1.2.1,<1.3',
16-
'basictracer>=2.2.0'],
16+
'basictracer>=2.2.0',
17+
'psutil>=5.1.3'],
1718
test_suite='nose.collector')

0 commit comments

Comments
 (0)