opentelemetry-instrumentation-aiopg 0.53b1__tar.gz → 0.54b0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (12) hide show
  1. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/PKG-INFO +3 -3
  2. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/pyproject.toml +2 -2
  3. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/src/opentelemetry/instrumentation/aiopg/__init__.py +33 -20
  4. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/src/opentelemetry/instrumentation/aiopg/version.py +1 -1
  5. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/.gitignore +0 -0
  6. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/LICENSE +0 -0
  7. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/README.rst +0 -0
  8. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py +0 -0
  9. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/src/opentelemetry/instrumentation/aiopg/package.py +0 -0
  10. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/src/opentelemetry/instrumentation/aiopg/wrappers.py +0 -0
  11. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/tests/__init__.py +0 -0
  12. {opentelemetry_instrumentation_aiopg-0.53b1 → opentelemetry_instrumentation_aiopg-0.54b0}/tests/test_aiopg_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opentelemetry-instrumentation-aiopg
3
- Version: 0.53b1
3
+ Version: 0.54b0
4
4
  Summary: OpenTelemetry aiopg instrumentation
5
5
  Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiopg
6
6
  Project-URL: Repository, https://github.com/open-telemetry/opentelemetry-python-contrib
@@ -20,8 +20,8 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
21
  Requires-Python: >=3.8
22
22
  Requires-Dist: opentelemetry-api~=1.12
23
- Requires-Dist: opentelemetry-instrumentation-dbapi==0.53b1
24
- Requires-Dist: opentelemetry-instrumentation==0.53b1
23
+ Requires-Dist: opentelemetry-instrumentation-dbapi==0.54b0
24
+ Requires-Dist: opentelemetry-instrumentation==0.54b0
25
25
  Requires-Dist: wrapt<2.0.0,>=1.0.0
26
26
  Provides-Extra: instruments
27
27
  Requires-Dist: aiopg<2.0.0,>=0.13.0; extra == 'instruments'
@@ -27,8 +27,8 @@ classifiers = [
27
27
  ]
28
28
  dependencies = [
29
29
  "opentelemetry-api ~= 1.12",
30
- "opentelemetry-instrumentation == 0.53b1",
31
- "opentelemetry-instrumentation-dbapi == 0.53b1",
30
+ "opentelemetry-instrumentation == 0.54b0",
31
+ "opentelemetry-instrumentation-dbapi == 0.54b0",
32
32
  "wrapt >= 1.0.0, < 2.0.0",
33
33
  ]
34
34
 
@@ -23,40 +23,53 @@ Usage
23
23
 
24
24
  .. code-block:: python
25
25
 
26
+ import asyncio
26
27
  import aiopg
27
28
  from opentelemetry.instrumentation.aiopg import AiopgInstrumentor
28
29
  # Call instrument() to wrap all database connections
29
30
  AiopgInstrumentor().instrument()
30
31
 
31
- cnx = await aiopg.connect(database='Database')
32
- cursor = await cnx.cursor()
33
- await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
34
- await cursor.execute("INSERT INTO test (testField) VALUES (123)")
35
- cursor.close()
36
- cnx.close()
32
+ dsn = 'user=user password=password host=127.0.0.1'
37
33
 
38
- pool = await aiopg.create_pool(database='Database')
34
+ async def connect():
35
+ cnx = await aiopg.connect(dsn)
36
+ cursor = await cnx.cursor()
37
+ await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
38
+ await cursor.execute("INSERT INTO test (testField) VALUES (123)")
39
+ cursor.close()
40
+ cnx.close()
39
41
 
40
- cnx = await pool.acquire()
41
- cursor = await cnx.cursor()
42
- await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
43
- await cursor.execute("INSERT INTO test (testField) VALUES (123)")
44
- cursor.close()
45
- cnx.close()
42
+ async def create_pool():
43
+ pool = await aiopg.create_pool(dsn)
44
+ cnx = await pool.acquire()
45
+ cursor = await cnx.cursor()
46
+ await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
47
+ await cursor.execute("INSERT INTO test (testField) VALUES (123)")
48
+ cursor.close()
49
+ cnx.close()
50
+
51
+ asyncio.run(connect())
52
+ asyncio.run(create_pool())
46
53
 
47
54
  .. code-block:: python
48
55
 
56
+ import asyncio
49
57
  import aiopg
50
58
  from opentelemetry.instrumentation.aiopg import AiopgInstrumentor
51
59
 
60
+ dsn = 'user=user password=password host=127.0.0.1'
61
+
52
62
  # Alternatively, use instrument_connection for an individual connection
53
- cnx = await aiopg.connect(database='Database')
54
- instrumented_cnx = AiopgInstrumentor().instrument_connection(cnx)
55
- cursor = await instrumented_cnx.cursor()
56
- await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
57
- await cursor.execute("INSERT INTO test (testField) VALUES (123)")
58
- cursor.close()
59
- instrumented_cnx.close()
63
+ async def go():
64
+ cnx = await aiopg.connect(dsn)
65
+ instrumented_cnx = AiopgInstrumentor().instrument_connection(cnx)
66
+ cursor = await instrumented_cnx.cursor()
67
+ await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
68
+ await cursor.execute("INSERT INTO test (testField) VALUES (123)")
69
+ cursor.close()
70
+ instrumented_cnx.close()
71
+
72
+ asyncio.run(go())
60
73
 
61
74
  API
62
75
  ---
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "0.53b1"
15
+ __version__ = "0.54b0"