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

udp6 support#396

Merged
yurishkuro merged 3 commits intojaegertracing:masterfrom
doochik:upd6-support
Sep 16, 2019
Merged

udp6 support#396
yurishkuro merged 3 commits intojaegertracing:masterfrom
doochik:upd6-support

Conversation

@doochik
Copy link
Copy Markdown
Contributor

@doochik doochik commented Sep 13, 2019

Which problem is this PR solving?

Jaegler client supports udp4 socket only.

Short description of the changes

I've added agentSocketType to reporter config to add support for IPv6 udp sockets.
https://nodejs.org/dist/latest-v10.x/docs/api/dgram.html#dgram_dgram_createsocket_type_callback

Example

const jaegerConfig = {
    reporter: {
        agentHost: 'jaeger-agent.query.consul',
        agentPort: 5775,
        agentSocketType: 'udp6',
    },
    ....
};

Copy link
Copy Markdown
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the PR.

Q: what would be the reasons for someone to prefer v6 over v4? Does it matter on the localhost for UDP? If there are good reasons, perhaps mention them in the readme when describing the new env var, as recommendation to the user.

@doochik
Copy link
Copy Markdown
Contributor Author

doochik commented Sep 13, 2019

Love the PR.

Q: what would be the reasons for someone to prefer v6 over v4? Does it matter on the localhost for UDP? If there are good reasons, perhaps mention them in the readme when describing the new env var, as recommendation to the user.

I have external (not localhost) ipv6-only jaeger-agent. So I can't use udp4.

@yurishkuro
Copy link
Copy Markdown
Member

I have external (not localhost) ipv6-only jaeger-agent. So I can't use udp4.

We don't recommend non-local agents, the agent wasn't designed for this. For sending spans to a remote received it's better to use TCP-based protocols, e.g. HTTP directly to the collector.

@doochik doochik force-pushed the upd6-support branch 2 times, most recently from bad4d71 to 43d5231 Compare September 14, 2019 09:37
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 14, 2019

Codecov Report

Merging #396 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #396      +/-   ##
==========================================
+ Coverage   98.65%   98.65%   +<.01%     
==========================================
  Files          50       50              
  Lines        2003     2010       +7     
  Branches      374      377       +3     
==========================================
+ Hits         1976     1983       +7     
  Misses         27       27
Impacted Files Coverage Δ
src/configuration.js 98.97% <100%> (+0.02%) ⬆️
src/reporters/udp_sender.js 98.73% <100%> (+0.03%) ⬆️
src/configuration_env.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cbc7e9...8e0b003. Read the comment docs.

@doochik
Copy link
Copy Markdown
Contributor Author

doochik commented Sep 14, 2019

@yurishkuro I've fixed all of you comments

});

it('should gracefully handle errors emitted by socket.send', function(done) {
// EAI_AGAIN - nodejs received invalid DNS response. E.g. resolver doesn't support IPv6.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would this error happen in the test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This errors occurs when dns resolver doesn't support IPv6 or host doesn't have ipv6 resolver. I've got this error in travis for upd6 and foo.bar.xyz instead of ENOTFOUND.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example,
on my local Mac I've got ENOTFOUND for this domain because I have dns resolver.
In travis I've got EAI_AGAIN

it('should gracefully handle errors emitted by socket.send', function(done) {
// EAI_AGAIN - nodejs received invalid DNS response. E.g. resolver doesn't support IPv6.
// ENOTFOUND - nodejs received valid DNS response but domain not found
// ESRCH - nodejs v0.10 error
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that specifically for udp6? Since before the tests were passing with just ENOTFOUND

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, is specifically for upd6

@doochik doochik force-pushed the upd6-support branch 3 times, most recently from e8a8b69 to 2e2238d Compare September 15, 2019 13:58
@doochik
Copy link
Copy Markdown
Contributor Author

doochik commented Sep 15, 2019

Red tests because of this regression Raynos/error#19

deps: jaeger-client-node -> tchannel, thriftrw -> bufrw -> error

Add tests for configuration options

Signed-off-by: Aleksei Androsov <[email protected]>
@doochik
Copy link
Copy Markdown
Contributor Author

doochik commented Sep 16, 2019

Tests are green

@yurishkuro yurishkuro merged commit 4a35dd1 into jaegertracing:master Sep 16, 2019
@doochik
Copy link
Copy Markdown
Contributor Author

doochik commented Sep 18, 2019

@yurishkuro could you release new version please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants