Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Use ip tag instead of peer.ipv4 in process (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
black-adder committed Jun 8, 2017
1 parent ee45053 commit 0c11b08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export const JAEGER_CLIENT_VERSION_TAG_KEY = 'jaeger.version';
// TRACER_HOSTNAME_TAG_KEY used to report host name of the process.
export const TRACER_HOSTNAME_TAG_KEY = 'jaeger.hostname';

// PROCESS_IP used to report ip of the process.
export const PROCESS_IP = 'ip';

// SAMPLER_TYPE_TAG_KEY reports which sampler was used on the root span.
export const SAMPLER_TYPE_TAG_KEY = 'sampler.type';

Expand Down
2 changes: 1 addition & 1 deletion src/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class Tracer {
this._tags = options.tags || {};
this._tags[constants.JAEGER_CLIENT_VERSION_TAG_KEY] = `Node-${pjson.version}`;
this._tags[constants.TRACER_HOSTNAME_TAG_KEY] = os.hostname();
this._tags[opentracing.Tags.PEER_HOST_IPV4] = Utils.ipToInt(Utils.myIp());
this._tags[constants.PROCESS_IP] = Utils.ipToInt(Utils.myIp());

this._metrics = options.metrics || new Metrics(new NoopMetricFactory());

Expand Down
6 changes: 3 additions & 3 deletions test/udp_sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ describe('udp sender should', () => {
return o.key;
});
assert.equal(actualTags.length, 3);
assert.equal(actualTags[0].key, 'jaeger.hostname');
assert.equal(actualTags[1].key, 'jaeger.version');
assert.equal(actualTags[2].key, 'peer.ipv4');
assert.equal(actualTags[0].key, 'ip');
assert.equal(actualTags[1].key, 'jaeger.hostname');
assert.equal(actualTags[2].key, 'jaeger.version');

sender.close();
done();
Expand Down

0 comments on commit 0c11b08

Please sign in to comment.