This repository was archived by the owner on Jul 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 4545JAEGER_VERSION_TAG_KEY = 'jaeger.version'
4646
4747# Tracer-scoped tag that contains the hostname
48- JAEGER_HOSTNAME_TAG_KEY = 'jaeger.hostname'
48+ JAEGER_HOSTNAME_TAG_KEY = 'hostname'
49+
50+ # Tracer-scoped tag that is used to report ip of the process.
51+ JAEGER_IP_TAG_KEY = 'ip'
4952
5053# the type of sampler that always makes the same decision.
5154SAMPLER_TYPE_CONST = 'const'
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ def __init__(
8080 self .codecs .update (extra_codecs )
8181 self .tags = {
8282 constants .JAEGER_VERSION_TAG_KEY : constants .JAEGER_CLIENT_VERSION ,
83+ constants .JAEGER_IP_TAG_KEY : self .ip_address ,
8384 }
8485 if tags :
8586 self .tags .update (tags )
Original file line number Diff line number Diff line change @@ -169,13 +169,15 @@ def test_serialization_error(tracer):
169169 )
170170
171171
172- def test_tracer_tags_hostname ():
172+ def test_tracer_tags ():
173173 reporter = mock .MagicMock ()
174174 sampler = ConstSampler (True )
175175
176176 with mock .patch ('socket.gethostname' , return_value = 'dream-host.com' ):
177177 t = Tracer (service_name = 'x' , reporter = reporter , sampler = sampler )
178- assert t .tags .get (c .JAEGER_HOSTNAME_TAG_KEY ) == 'dream-host.com'
178+ assert t .tags .get ('hostname' ) == 'dream-host.com'
179+ assert 'ip' in t .tags
180+ assert 'jaeger.version' in t .tags
179181
180182
181183def test_tracer_tags_passed_to_reporter ():
You can’t perform that action at this time.
0 commit comments