From: Lars Marowsky-Bree Date: Thu, 27 Feb 2020 10:11:01 +0000 (+0100) Subject: mgr/telemetry: fix and document proxy usage X-Git-Tag: v15.1.1~187^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d7c79b079827dffdabf78bd18c2930cfed92286;p=ceph.git mgr/telemetry: fix and document proxy usage This addresses https://tracker.ceph.com/issues/44320 - fix and document use of proxies for mgr/telemetry. Signed-off-by: Lars Marowsky-Bree --- diff --git a/doc/mgr/telemetry.rst b/doc/mgr/telemetry.rst index ea42d387ea1..9734b7b8e14 100644 --- a/doc/mgr/telemetry.rst +++ b/doc/mgr/telemetry.rst @@ -114,6 +114,20 @@ The see the current configuration:: ceph telemetry status +Sending telemetry through a proxy +--------------------------------- + +If the cluster cannot directly connect to the configured telemetry +endpoint (default *telemetry.ceph.com*), you can configure a HTTP/HTTPS +proxy server with:: + + ceph config set mgr mgr/telemetry/proxy https://10.0.0.1:8080 + +You can also include a *user:pass* if needed:: + + ceph config set mgr mgr/telemetry/proxy https://ceph:telemetry@10.0.0.1:8080 + + Contact and Description ----------------------- diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 52d83d3263c..d1f416c69f9 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -681,7 +681,7 @@ class Module(MgrModule): proxies['http'] = self.proxy proxies['https'] = self.proxy try: - resp = requests.put(url=url, json=report) + resp = requests.put(url=url, json=report, proxies=proxies) resp.raise_for_status() except Exception as e: fail_reason = 'Failed to send %s to %s: %s' % (what, url, str(e))