Skip to content

Commit

Permalink
Allow to set custom hostname for jaeger agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
djshen-ponddy committed Jul 26, 2017
1 parent 19044af commit 68cfb4f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion jaeger_client/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from .metrics import Metrics
from .utils import get_boolean, ErrorReporter

DEFAULT_REPORTING_HOST = 'localhost'
DEFAULT_REPORTING_PORT = 5775
DEFAULT_SAMPLING_PORT = 5778
LOCAL_AGENT_DEFAULT_ENABLED = True
Expand Down Expand Up @@ -212,6 +213,14 @@ def local_agent_reporting_port(self):
except:
return DEFAULT_REPORTING_PORT

@property
def local_agent_reporting_host(self):
# noinspection PyBroadException
try:
return self.local_agent_group()['reporting_host']
except:
return DEFAULT_REPORTING_HOST

@property
def max_operations(self):
return self.config.get('max_operations', None)
Expand Down Expand Up @@ -293,7 +302,7 @@ def _create_local_agent_channel(self, io_loop):
"""
logger.info('Initializing Jaeger Tracer with UDP reporter')
return LocalAgentSender(
host='localhost',
host=self.local_agent_reporting_host,
sampling_port=self.local_agent_sampling_port,
reporting_port=self.local_agent_reporting_port,
io_loop=io_loop
Expand Down

0 comments on commit 68cfb4f

Please sign in to comment.