From da529bdbb8c37dbab833ea47359ecb3002f348e4 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Tue, 10 Dec 2024 17:28:11 -0800 Subject: [PATCH] Fix psycopg2/3 docs --- docs-requirements.txt | 1 + docs/conf.py | 2 ++ .../src/opentelemetry/instrumentation/psycopg/__init__.py | 4 ++-- .../opentelemetry/instrumentation/psycopg2/__init__.py | 8 ++++---- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs-requirements.txt b/docs-requirements.txt index d547e806a3..9274aeef8d 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -32,6 +32,7 @@ mysqlclient~=2.1.1 openai >= 1.26.0 psutil>=5 psycopg~=3.1.17 +psycopg2~=2.9.9 pika>=0.12.0 pymongo~=4.6.3 PyMySQL~=1.1.1 diff --git a/docs/conf.py b/docs/conf.py index 8233fccb15..3dca3d05f5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -122,6 +122,8 @@ "https://opentelemetry-python.readthedocs.io/en/latest/", None, ), + "psycopg": ("https://www.psycopg.org/psycopg3/docs/", None), + "psycopg2": ("https://www.psycopg.org/docs/", None), } # http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py index af66aa6d02..35c0720173 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py @@ -16,7 +16,7 @@ The integration with PostgreSQL supports the `Psycopg`_ library, it can be enabled by using ``PsycopgInstrumentor``. -.. _Psycopg: http://initd.org/psycopg/ +.. _Psycopg: https://www.psycopg.org/psycopg3/docs/ SQLCOMMENTER ***************************************** @@ -139,7 +139,7 @@ def instrumentation_dependencies(self) -> Collection[str]: def _instrument(self, **kwargs): """Integrate with PostgreSQL Psycopg library. - Psycopg: http://initd.org/psycopg/ + Psycopg: https://www.psycopg.org/psycopg3/docs/ """ tracer_provider = kwargs.get("tracer_provider") enable_sqlcommenter = kwargs.get("enable_commenter", False) diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py index 9235a994bf..e8bd63e4ab 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py @@ -13,10 +13,10 @@ # limitations under the License. """ -The integration with PostgreSQL supports the `Psycopg`_ library, it can be enabled by +The integration with PostgreSQL supports the `Psycopg2`_ library, it can be enabled by using ``Psycopg2Instrumentor``. -.. _Psycopg: http://initd.org/psycopg/ +.. _Psycopg2: https://www.psycopg.org/docs/ SQLCOMMENTER ***************************************** @@ -138,8 +138,8 @@ def instrumentation_dependencies(self) -> Collection[str]: return _instruments def _instrument(self, **kwargs): - """Integrate with PostgreSQL Psycopg library. - Psycopg: http://initd.org/psycopg/ + """Integrate with PostgreSQL Psycopg2 library. + Psycopg2: https://www.psycopg.org/docs/ """ tracer_provider = kwargs.get("tracer_provider") enable_sqlcommenter = kwargs.get("enable_commenter", False)