open-telemetry / open-telemetry/opentelemetry-python
Support IPv6 transport for Jaeger agent (thrift over UDP) export
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Describe your environment
I'm trying to use an application that uses the OpenTelemetry library to export trace data to Jaeger. The Jaeger agent is not running in the same container as the application and there is only IPv6 connectivity to the Jaeger agent, thus, IPv6 is used. However, it does not work and leads to a traceback.
The code shown linked here is IPv4 only capable as it hard codes AF_INET:
Steps to reproduce
Configure an IPv6 address as the agent export host and run your program, which will crash as the address family provided to the socket (AF_INET) is inconsistent with the address (AF_INET6).
What is the expected behavior?
Data should be exported to Jaeger as normal but over an IPv6 socket.
What is the actual behavior?
<ERROR> 27-Jan-2021::17:47:49.939 opentelemetry.sdk.trace.export MainThread: - Exception while exporting Span.
Traceback (most recent call last):
File "/var/opt/ncs/packages/opentelemetry-exporter/pyvenv/lib/python3.7/site-packages/opentelemetry/sdk/trace/export/__init__.py", line 83, in on_end
self.span_exporter.export((span,))
File "/var/opt/ncs/packages/opentelemetry-exporter/pyvenv/lib/python3.7/site-packages/opentelemetry/exporter/jaeger/__init__.py", line 181, in export
self.agent_client.emit(batch)
File "/var/opt/ncs/packages/opentelemetry-exporter/pyvenv/lib/python3.7/site-packages/opentelemetry/exporter/jaeger/__init__.py", line 427, in emit
udp_socket.sendto(buff, self.address)
socket.gaierror: [Errno -9] Address family for hostname not supported
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py around line 76, where the UDP socket address family is hard-coded. Reproduce the failure with an IPv6 Jaeger agent address and trace how the exporter creates and uses the socket; done means trace data exports successfully over IPv6 without the address-family error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100