open-telemetry / open-telemetry/opentelemetry-cpp
[BUILD] CURL versions discrepancies with bazel
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 632
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 75
Description
Describe your environment
Ubuntu 20.04 with its curl/libcurl v 7.68.0-1ubuntu2.21
bazel 5.4.1
Steps to reproduce
Created an OtlpHttpExporter
What is the expected behavior?
No problem connecting, unsupported options not being used
What is the actual behavior?
[Error] File: external/io_opentelemetry_cpp/ext/src/http/client/curl/http_operation_curl.cc:526 CURL, set option <20312> failed: <An unknown option was passed in to libcurl>
[Error] File: external/io_opentelemetry_cpp/exporters/otlp/src/otlp_http_client.cc:200 [OTLP HTTP Client] Session state: connection failed.An unknown option was passed in to libcurl
[Error] File: external/io_opentelemetry_cpp/exporters/otlp/src/otlp_http_client.cc:168 [OTLP HTTP Client] Session state: session create failed.
[Error] File: external/io_opentelemetry_cpp/exporters/otlp/src/otlp_http_exporter.cc:118 [OTLP HTTP Client] ERROR: Export 4 trace span(s) error: 1
20312 is CURLOPT_PREREQFUNCTION you can see here that it is supported in curl 7.80.0 and above, although otlp exporter tries to use it for 7.5 and above which is exactly my case for producing the bug 7.5<7.68<7.80
So I think simply changing the test for the curl version will fix this bug, and I will post a PR for that in a couple of minutes.
The other option CURLOPT_PREREQDATA which is also concerned appeared in the same curl version 7.80.0, so all should be fine in one fix.
Not sure I can unit test that though...
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 with ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h and the referenced sections of ext/src/http/client/curl/http_operation_curl.cc. Compare the version checks for CURLOPT_PREREQFUNCTION and CURLOPT_PREREQDATA with their availability in curl 7.80.0; done means Ubuntu curl 7.68 no longer receives unsupported options and the OTLP HTTP exporter connects successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100