open-telemetry / open-telemetry/opentelemetry-python-contrib
PrometheusRemoteWriteMetricsExporter: tls_config["insecure_skip_verify"] results in opposite behavior to what is intended
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
In the code currently we have the following:
verify = True
if self.tls_config:
# ...
elif "insecure_skip_verify" in self.tls_config:
verify = self.tls_config["insecure_skip_verify"]
# ...
try:
response = requests.post(
self.endpoint,
data=message,
headers=headers,
auth=auth,
timeout=self.timeout,
proxies=self.proxies,
cert=cert,
verify=verify,
)
the verify keyword for requests.post will skip TLS certificate verification when the parameter is False, but the intention behind insecure_skip_verify is that the verification should be skipped when it is True. As a result this leads to needing to specify tls_config={"insecure_skip_verify": False} to get TLS certificate verification disabled.
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-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/init.py at the PrometheusRemoteWriteMetricsExporter request code linked in the issue. Check how tls_config["insecure_skip_verify"] is passed to requests.post and verify that its true/false behavior matches the option's intended meaning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- prometheus, python
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100