opentelemetry-instrumentation 0.43b0__tar.gz → 0.45b0__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 (29) hide show
  1. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/PKG-INFO +31 -27
  2. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/README.rst +28 -22
  3. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/pyproject.toml +1 -5
  4. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/auto_instrumentation/__init__.py +0 -2
  5. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/bootstrap.py +0 -2
  6. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/bootstrap_gen.py +54 -53
  7. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/utils.py +48 -3
  8. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/version.py +1 -1
  9. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/.gitignore +0 -0
  10. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/LICENSE +0 -0
  11. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/_semconv.py +0 -0
  12. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/auto_instrumentation/_load.py +0 -0
  13. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py +0 -0
  14. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/dependencies.py +0 -0
  15. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/distro.py +0 -0
  16. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/environment_variables.py +0 -0
  17. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/instrumentor.py +0 -0
  18. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/propagators.py +0 -0
  19. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/py.typed +0 -0
  20. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/src/opentelemetry/instrumentation/sqlcommenter_utils.py +0 -0
  21. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/__init__.py +0 -0
  22. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/auto_instrumentation/test_load.py +0 -0
  23. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/auto_instrumentation/test_run.py +0 -0
  24. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/test_bootstrap.py +0 -0
  25. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/test_dependencies.py +0 -0
  26. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/test_distro.py +0 -0
  27. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/test_instrumentor.py +0 -0
  28. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/test_propagators.py +0 -0
  29. {opentelemetry_instrumentation-0.43b0 → opentelemetry_instrumentation-0.45b0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: opentelemetry-instrumentation
3
- Version: 0.43b0
3
+ Version: 0.45b0
4
4
  Summary: Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python
5
5
  Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation
6
6
  Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
@@ -11,16 +11,14 @@ Classifier: Intended Audience :: Developers
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Programming Language :: Python
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.7
15
14
  Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
- Requires-Python: >=3.7
18
+ Requires-Python: >=3.8
20
19
  Requires-Dist: opentelemetry-api~=1.4
21
20
  Requires-Dist: setuptools>=16.0
22
21
  Requires-Dist: wrapt<2.0.0,>=1.0.0
23
- Provides-Extra: test
24
22
  Description-Content-Type: text/x-rst
25
23
 
26
24
  OpenTelemetry Instrumentation
@@ -39,7 +37,7 @@ Installation
39
37
  pip install opentelemetry-instrumentation
40
38
 
41
39
 
42
- This package provides a couple of commands that help automatically instruments a program:
40
+ This package provides commands that help automatically instrument a program:
43
41
 
44
42
  .. note::
45
43
  You need to install a distro package to get auto instrumentation working. The ``opentelemetry-distro``
@@ -47,7 +45,7 @@ This package provides a couple of commands that help automatically instruments a
47
45
  For more info about ``opentelemetry-distro`` check `here <https://opentelemetry-python.readthedocs.io/en/latest/examples/distro/README.html>`__
48
46
  ::
49
47
 
50
- pip install opentelemetry-distro[otlp]
48
+ pip install "opentelemetry-distro[otlp]"
51
49
 
52
50
  When creating a custom distro and/or configurator, be sure to add entry points for each under `opentelemetry_distro` and `opentelemetry_configurator` respectfully.
53
51
  If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` environment variables.
@@ -58,13 +56,14 @@ opentelemetry-bootstrap
58
56
 
59
57
  ::
60
58
 
61
- opentelemetry-bootstrap --action=install|requirements
59
+ opentelemetry-bootstrap [-a |--action=][install|requirements]
62
60
 
63
- This commands inspects the active Python site-packages and figures out which
64
- instrumentation packages the user might want to install. By default it prints out
65
- a list of the suggested instrumentation packages which can be added to a requirements.txt
66
- file. It also supports installing the suggested packages when run with :code:`--action=install`
67
- flag.
61
+ This command install default instrumentation packages and detects active Python site-packages
62
+ to figure out which instrumentation packages the user might want to install. By default, it
63
+ prints out a list of the default and detected instrumentation packages that can be added to a
64
+ requirements.txt file. It also supports installing the packages when run with
65
+ :code:`--action=install` or :code:`-a install` flag. All default and detectable
66
+ instrumentation packages are defined `here <https://github.com/flands/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py>`.
68
67
 
69
68
 
70
69
  opentelemetry-instrument
@@ -76,12 +75,12 @@ opentelemetry-instrument
76
75
 
77
76
  The instrument command will try to automatically detect packages used by your python program
78
77
  and when possible, apply automatic tracing instrumentation on them. This means your program
79
- will get automatic distributed tracing for free without having to make any code changes
80
- at all. This will also configure a global tracer and tracing exporter without you having to
81
- make any code changes. By default, the instrument command will use the OTLP exporter but
82
- this can be overridden when needed.
78
+ will get automatic distributed tracing without having to make any code changes. This will
79
+ also configure a global tracer and tracing exporter as well as a meter and meter exporter.
80
+ By default, the instrument command will use the OTLP exporter but this can be overridden.
83
81
 
84
- The command supports the following configuration options as CLI arguments and environment vars:
82
+ The command supports the following configuration options as CLI arguments and environment
83
+ variables:
85
84
 
86
85
 
87
86
  * ``--traces_exporter`` or ``OTEL_TRACES_EXPORTER``
@@ -89,27 +88,32 @@ The command supports the following configuration options as CLI arguments and en
89
88
  * ``--distro`` or ``OTEL_PYTHON_DISTRO``
90
89
  * ``--configurator`` or ``OTEL_PYTHON_CONFIGURATOR``
91
90
 
92
- Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter
93
- names (see below).
91
+ The exporter options define what exporter destination to use and can be set to one or more
92
+ exporter names (see below). You can pass multiple values to configure multiple exporters
93
+ (e.g., ``zipkin_json,otlp``).
94
94
 
95
95
  - Defaults to `otlp`.
96
96
  - Can be set to `none` to disable automatic tracer initialization.
97
+ - Can be set to 'console` to display JSON results locally.
97
98
 
98
- You can pass multiple values to configure multiple exporters e.g, ``zipkin,prometheus``
99
-
100
- Well known trace exporter names:
99
+ Trace exporter names:
101
100
 
102
101
  - jaeger_proto
103
102
  - jaeger_thrift
104
103
  - opencensus
104
+ - otlp
105
+ - otlp_proto_grpc (`deprecated`)
106
+ - otlp_proto_http (`deprecated`)
105
107
  - zipkin_json
106
108
  - zipkin_proto
109
+
110
+ Metric exporter names:
111
+
107
112
  - otlp
108
113
  - otlp_proto_grpc (`deprecated`)
109
- - otlp_proto_http (`deprecated`)
114
+ - prometheus
110
115
 
111
116
  Note: The default transport protocol for ``otlp`` is gRPC.
112
- HTTP is currently supported for traces only, and should be set using ``OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf``
113
117
 
114
118
  * ``--id-generator`` or ``OTEL_PYTHON_ID_GENERATOR``
115
119
 
@@ -131,9 +135,9 @@ Examples
131
135
 
132
136
  ::
133
137
 
134
- opentelemetry-instrument --traces_exporter otlp flask run --port=3000
138
+ opentelemetry-instrument --traces_exporter console flask run --port=3000
135
139
 
136
- The above command will pass ``--traces_exporter otlp`` to the instrument command and ``--port=3000`` to ``flask run``.
140
+ The above command will pass ``--traces_exporter console`` to the instrument command and ``--port=3000`` to ``flask run``.
137
141
 
138
142
  ::
139
143
 
@@ -14,7 +14,7 @@ Installation
14
14
  pip install opentelemetry-instrumentation
15
15
 
16
16
 
17
- This package provides a couple of commands that help automatically instruments a program:
17
+ This package provides commands that help automatically instrument a program:
18
18
 
19
19
  .. note::
20
20
  You need to install a distro package to get auto instrumentation working. The ``opentelemetry-distro``
@@ -22,7 +22,7 @@ This package provides a couple of commands that help automatically instruments a
22
22
  For more info about ``opentelemetry-distro`` check `here <https://opentelemetry-python.readthedocs.io/en/latest/examples/distro/README.html>`__
23
23
  ::
24
24
 
25
- pip install opentelemetry-distro[otlp]
25
+ pip install "opentelemetry-distro[otlp]"
26
26
 
27
27
  When creating a custom distro and/or configurator, be sure to add entry points for each under `opentelemetry_distro` and `opentelemetry_configurator` respectfully.
28
28
  If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` environment variables.
@@ -33,13 +33,14 @@ opentelemetry-bootstrap
33
33
 
34
34
  ::
35
35
 
36
- opentelemetry-bootstrap --action=install|requirements
36
+ opentelemetry-bootstrap [-a |--action=][install|requirements]
37
37
 
38
- This commands inspects the active Python site-packages and figures out which
39
- instrumentation packages the user might want to install. By default it prints out
40
- a list of the suggested instrumentation packages which can be added to a requirements.txt
41
- file. It also supports installing the suggested packages when run with :code:`--action=install`
42
- flag.
38
+ This command install default instrumentation packages and detects active Python site-packages
39
+ to figure out which instrumentation packages the user might want to install. By default, it
40
+ prints out a list of the default and detected instrumentation packages that can be added to a
41
+ requirements.txt file. It also supports installing the packages when run with
42
+ :code:`--action=install` or :code:`-a install` flag. All default and detectable
43
+ instrumentation packages are defined `here <https://github.com/flands/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py>`.
43
44
 
44
45
 
45
46
  opentelemetry-instrument
@@ -51,12 +52,12 @@ opentelemetry-instrument
51
52
 
52
53
  The instrument command will try to automatically detect packages used by your python program
53
54
  and when possible, apply automatic tracing instrumentation on them. This means your program
54
- will get automatic distributed tracing for free without having to make any code changes
55
- at all. This will also configure a global tracer and tracing exporter without you having to
56
- make any code changes. By default, the instrument command will use the OTLP exporter but
57
- this can be overridden when needed.
55
+ will get automatic distributed tracing without having to make any code changes. This will
56
+ also configure a global tracer and tracing exporter as well as a meter and meter exporter.
57
+ By default, the instrument command will use the OTLP exporter but this can be overridden.
58
58
 
59
- The command supports the following configuration options as CLI arguments and environment vars:
59
+ The command supports the following configuration options as CLI arguments and environment
60
+ variables:
60
61
 
61
62
 
62
63
  * ``--traces_exporter`` or ``OTEL_TRACES_EXPORTER``
@@ -64,27 +65,32 @@ The command supports the following configuration options as CLI arguments and en
64
65
  * ``--distro`` or ``OTEL_PYTHON_DISTRO``
65
66
  * ``--configurator`` or ``OTEL_PYTHON_CONFIGURATOR``
66
67
 
67
- Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter
68
- names (see below).
68
+ The exporter options define what exporter destination to use and can be set to one or more
69
+ exporter names (see below). You can pass multiple values to configure multiple exporters
70
+ (e.g., ``zipkin_json,otlp``).
69
71
 
70
72
  - Defaults to `otlp`.
71
73
  - Can be set to `none` to disable automatic tracer initialization.
74
+ - Can be set to 'console` to display JSON results locally.
72
75
 
73
- You can pass multiple values to configure multiple exporters e.g, ``zipkin,prometheus``
74
-
75
- Well known trace exporter names:
76
+ Trace exporter names:
76
77
 
77
78
  - jaeger_proto
78
79
  - jaeger_thrift
79
80
  - opencensus
81
+ - otlp
82
+ - otlp_proto_grpc (`deprecated`)
83
+ - otlp_proto_http (`deprecated`)
80
84
  - zipkin_json
81
85
  - zipkin_proto
86
+
87
+ Metric exporter names:
88
+
82
89
  - otlp
83
90
  - otlp_proto_grpc (`deprecated`)
84
- - otlp_proto_http (`deprecated`)
91
+ - prometheus
85
92
 
86
93
  Note: The default transport protocol for ``otlp`` is gRPC.
87
- HTTP is currently supported for traces only, and should be set using ``OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf``
88
94
 
89
95
  * ``--id-generator`` or ``OTEL_PYTHON_ID_GENERATOR``
90
96
 
@@ -106,9 +112,9 @@ Examples
106
112
 
107
113
  ::
108
114
 
109
- opentelemetry-instrument --traces_exporter otlp flask run --port=3000
115
+ opentelemetry-instrument --traces_exporter console flask run --port=3000
110
116
 
111
- The above command will pass ``--traces_exporter otlp`` to the instrument command and ``--port=3000`` to ``flask run``.
117
+ The above command will pass ``--traces_exporter console`` to the instrument command and ``--port=3000`` to ``flask run``.
112
118
 
113
119
  ::
114
120
 
@@ -8,7 +8,7 @@ dynamic = ["version"]
8
8
  description = "Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python"
9
9
  readme = "README.rst"
10
10
  license = "Apache-2.0"
11
- requires-python = ">=3.7"
11
+ requires-python = ">=3.8"
12
12
  authors = [
13
13
  { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
14
14
  ]
@@ -18,7 +18,6 @@ classifiers = [
18
18
  "License :: OSI Approved :: Apache Software License",
19
19
  "Programming Language :: Python",
20
20
  "Programming Language :: Python :: 3",
21
- "Programming Language :: Python :: 3.7",
22
21
  "Programming Language :: Python :: 3.8",
23
22
  "Programming Language :: Python :: 3.9",
24
23
  "Programming Language :: Python :: 3.10",
@@ -30,9 +29,6 @@ dependencies = [
30
29
  "wrapt >= 1.0.0, < 2.0.0",
31
30
  ]
32
31
 
33
- [project.optional-dependencies]
34
- test = []
35
-
36
32
  [project.scripts]
37
33
  opentelemetry-bootstrap = "opentelemetry.instrumentation.bootstrap:run"
38
34
  opentelemetry-instrument = "opentelemetry.instrumentation.auto_instrumentation:run"
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env python3
2
-
3
1
  # Copyright The OpenTelemetry Authors
4
2
  #
5
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env python3
2
-
3
1
  # Copyright The OpenTelemetry Authors
4
2
  #
5
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,178 +18,179 @@
18
18
  libraries = [
19
19
  {
20
20
  "library": "aio_pika >= 7.2.0, < 10.0.0",
21
- "instrumentation": "opentelemetry-instrumentation-aio-pika==0.43b0",
21
+ "instrumentation": "opentelemetry-instrumentation-aio-pika==0.45b0",
22
22
  },
23
23
  {
24
24
  "library": "aiohttp ~= 3.0",
25
- "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.43b0",
25
+ "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.45b0",
26
26
  },
27
27
  {
28
28
  "library": "aiohttp ~= 3.0",
29
- "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.43b0",
29
+ "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.45b0",
30
30
  },
31
31
  {
32
32
  "library": "aiopg >= 0.13.0, < 2.0.0",
33
- "instrumentation": "opentelemetry-instrumentation-aiopg==0.43b0",
33
+ "instrumentation": "opentelemetry-instrumentation-aiopg==0.45b0",
34
34
  },
35
35
  {
36
36
  "library": "asgiref ~= 3.0",
37
- "instrumentation": "opentelemetry-instrumentation-asgi==0.43b0",
37
+ "instrumentation": "opentelemetry-instrumentation-asgi==0.45b0",
38
38
  },
39
39
  {
40
40
  "library": "asyncpg >= 0.12.0",
41
- "instrumentation": "opentelemetry-instrumentation-asyncpg==0.43b0",
41
+ "instrumentation": "opentelemetry-instrumentation-asyncpg==0.45b0",
42
42
  },
43
43
  {
44
44
  "library": "boto~=2.0",
45
- "instrumentation": "opentelemetry-instrumentation-boto==0.43b0",
45
+ "instrumentation": "opentelemetry-instrumentation-boto==0.45b0",
46
46
  },
47
47
  {
48
48
  "library": "boto3 ~= 1.0",
49
- "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.43b0",
49
+ "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.45b0",
50
50
  },
51
51
  {
52
52
  "library": "botocore ~= 1.0",
53
- "instrumentation": "opentelemetry-instrumentation-botocore==0.43b0",
53
+ "instrumentation": "opentelemetry-instrumentation-botocore==0.45b0",
54
54
  },
55
55
  {
56
56
  "library": "cassandra-driver ~= 3.25",
57
- "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0",
57
+ "instrumentation": "opentelemetry-instrumentation-cassandra==0.45b0",
58
58
  },
59
59
  {
60
60
  "library": "scylla-driver ~= 3.25",
61
- "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0",
61
+ "instrumentation": "opentelemetry-instrumentation-cassandra==0.45b0",
62
62
  },
63
63
  {
64
64
  "library": "celery >= 4.0, < 6.0",
65
- "instrumentation": "opentelemetry-instrumentation-celery==0.43b0",
65
+ "instrumentation": "opentelemetry-instrumentation-celery==0.45b0",
66
66
  },
67
67
  {
68
- "library": "confluent-kafka >= 1.8.2, <= 2.2.0",
69
- "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.43b0",
68
+ "library": "confluent-kafka >= 1.8.2, <= 2.3.0",
69
+ "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.45b0",
70
70
  },
71
71
  {
72
72
  "library": "django >= 1.10",
73
- "instrumentation": "opentelemetry-instrumentation-django==0.43b0",
73
+ "instrumentation": "opentelemetry-instrumentation-django==0.45b0",
74
74
  },
75
75
  {
76
76
  "library": "elasticsearch >= 2.0",
77
- "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.43b0",
77
+ "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.45b0",
78
78
  },
79
79
  {
80
80
  "library": "falcon >= 1.4.1, < 3.1.2",
81
- "instrumentation": "opentelemetry-instrumentation-falcon==0.43b0",
81
+ "instrumentation": "opentelemetry-instrumentation-falcon==0.45b0",
82
82
  },
83
83
  {
84
84
  "library": "fastapi ~= 0.58",
85
- "instrumentation": "opentelemetry-instrumentation-fastapi==0.43b0",
85
+ "instrumentation": "opentelemetry-instrumentation-fastapi==0.45b0",
86
86
  },
87
87
  {
88
- "library": "flask >= 1.0, < 3.0",
89
- "instrumentation": "opentelemetry-instrumentation-flask==0.43b0",
90
- },
91
- {
92
- "library": "werkzeug < 3.0.0",
93
- "instrumentation": "opentelemetry-instrumentation-flask==0.43b0",
88
+ "library": "flask >= 1.0",
89
+ "instrumentation": "opentelemetry-instrumentation-flask==0.45b0",
94
90
  },
95
91
  {
96
92
  "library": "grpcio ~= 1.27",
97
- "instrumentation": "opentelemetry-instrumentation-grpc==0.43b0",
93
+ "instrumentation": "opentelemetry-instrumentation-grpc==0.45b0",
98
94
  },
99
95
  {
100
96
  "library": "httpx >= 0.18.0",
101
- "instrumentation": "opentelemetry-instrumentation-httpx==0.43b0",
97
+ "instrumentation": "opentelemetry-instrumentation-httpx==0.45b0",
102
98
  },
103
99
  {
104
100
  "library": "jinja2 >= 2.7, < 4.0",
105
- "instrumentation": "opentelemetry-instrumentation-jinja2==0.43b0",
101
+ "instrumentation": "opentelemetry-instrumentation-jinja2==0.45b0",
106
102
  },
107
103
  {
108
104
  "library": "kafka-python >= 2.0",
109
- "instrumentation": "opentelemetry-instrumentation-kafka-python==0.43b0",
105
+ "instrumentation": "opentelemetry-instrumentation-kafka-python==0.45b0",
110
106
  },
111
107
  {
112
108
  "library": "mysql-connector-python ~= 8.0",
113
- "instrumentation": "opentelemetry-instrumentation-mysql==0.43b0",
109
+ "instrumentation": "opentelemetry-instrumentation-mysql==0.45b0",
114
110
  },
115
111
  {
116
112
  "library": "mysqlclient < 3",
117
- "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.43b0",
113
+ "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.45b0",
118
114
  },
119
115
  {
120
116
  "library": "pika >= 0.12.0",
121
- "instrumentation": "opentelemetry-instrumentation-pika==0.43b0",
117
+ "instrumentation": "opentelemetry-instrumentation-pika==0.45b0",
118
+ },
119
+ {
120
+ "library": "psycopg >= 3.1.0",
121
+ "instrumentation": "opentelemetry-instrumentation-psycopg==0.45b0",
122
122
  },
123
123
  {
124
124
  "library": "psycopg2 >= 2.7.3.1",
125
- "instrumentation": "opentelemetry-instrumentation-psycopg2==0.43b0",
125
+ "instrumentation": "opentelemetry-instrumentation-psycopg2==0.45b0",
126
126
  },
127
127
  {
128
128
  "library": "pymemcache >= 1.3.5, < 5",
129
- "instrumentation": "opentelemetry-instrumentation-pymemcache==0.43b0",
129
+ "instrumentation": "opentelemetry-instrumentation-pymemcache==0.45b0",
130
130
  },
131
131
  {
132
132
  "library": "pymongo >= 3.1, < 5.0",
133
- "instrumentation": "opentelemetry-instrumentation-pymongo==0.43b0",
133
+ "instrumentation": "opentelemetry-instrumentation-pymongo==0.45b0",
134
134
  },
135
135
  {
136
136
  "library": "PyMySQL < 2",
137
- "instrumentation": "opentelemetry-instrumentation-pymysql==0.43b0",
137
+ "instrumentation": "opentelemetry-instrumentation-pymysql==0.45b0",
138
138
  },
139
139
  {
140
140
  "library": "pyramid >= 1.7",
141
- "instrumentation": "opentelemetry-instrumentation-pyramid==0.43b0",
141
+ "instrumentation": "opentelemetry-instrumentation-pyramid==0.45b0",
142
142
  },
143
143
  {
144
144
  "library": "redis >= 2.6",
145
- "instrumentation": "opentelemetry-instrumentation-redis==0.43b0",
145
+ "instrumentation": "opentelemetry-instrumentation-redis==0.45b0",
146
146
  },
147
147
  {
148
148
  "library": "remoulade >= 0.50",
149
- "instrumentation": "opentelemetry-instrumentation-remoulade==0.43b0",
149
+ "instrumentation": "opentelemetry-instrumentation-remoulade==0.45b0",
150
150
  },
151
151
  {
152
152
  "library": "requests ~= 2.0",
153
- "instrumentation": "opentelemetry-instrumentation-requests==0.43b0",
153
+ "instrumentation": "opentelemetry-instrumentation-requests==0.45b0",
154
154
  },
155
155
  {
156
156
  "library": "scikit-learn ~= 0.24.0",
157
- "instrumentation": "opentelemetry-instrumentation-sklearn==0.43b0",
157
+ "instrumentation": "opentelemetry-instrumentation-sklearn==0.45b0",
158
158
  },
159
159
  {
160
160
  "library": "sqlalchemy",
161
- "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.43b0",
161
+ "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.45b0",
162
162
  },
163
163
  {
164
164
  "library": "starlette ~= 0.13.0",
165
- "instrumentation": "opentelemetry-instrumentation-starlette==0.43b0",
165
+ "instrumentation": "opentelemetry-instrumentation-starlette==0.45b0",
166
166
  },
167
167
  {
168
168
  "library": "psutil >= 5",
169
- "instrumentation": "opentelemetry-instrumentation-system-metrics==0.43b0",
169
+ "instrumentation": "opentelemetry-instrumentation-system-metrics==0.45b0",
170
170
  },
171
171
  {
172
172
  "library": "tornado >= 5.1.1",
173
- "instrumentation": "opentelemetry-instrumentation-tornado==0.43b0",
173
+ "instrumentation": "opentelemetry-instrumentation-tornado==0.45b0",
174
174
  },
175
175
  {
176
176
  "library": "tortoise-orm >= 0.17.0",
177
- "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0",
177
+ "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.45b0",
178
178
  },
179
179
  {
180
180
  "library": "pydantic >= 1.10.2",
181
- "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0",
181
+ "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.45b0",
182
182
  },
183
183
  {
184
184
  "library": "urllib3 >= 1.0.0, < 3.0.0",
185
- "instrumentation": "opentelemetry-instrumentation-urllib3==0.43b0",
185
+ "instrumentation": "opentelemetry-instrumentation-urllib3==0.45b0",
186
186
  },
187
187
  ]
188
188
  default_instrumentations = [
189
- "opentelemetry-instrumentation-aws-lambda==0.43b0",
190
- "opentelemetry-instrumentation-dbapi==0.43b0",
191
- "opentelemetry-instrumentation-logging==0.43b0",
192
- "opentelemetry-instrumentation-sqlite3==0.43b0",
193
- "opentelemetry-instrumentation-urllib==0.43b0",
194
- "opentelemetry-instrumentation-wsgi==0.43b0",
189
+ "opentelemetry-instrumentation-asyncio==0.45b0",
190
+ "opentelemetry-instrumentation-aws-lambda==0.45b0",
191
+ "opentelemetry-instrumentation-dbapi==0.45b0",
192
+ "opentelemetry-instrumentation-logging==0.45b0",
193
+ "opentelemetry-instrumentation-sqlite3==0.45b0",
194
+ "opentelemetry-instrumentation-urllib==0.45b0",
195
+ "opentelemetry-instrumentation-wsgi==0.45b0",
195
196
  ]
@@ -13,16 +13,22 @@
13
13
  # limitations under the License.
14
14
 
15
15
  import urllib.parse
16
+ from contextlib import contextmanager
16
17
  from re import escape, sub
17
- from typing import Dict, Sequence
18
+ from typing import Dict, Iterable, Sequence
18
19
 
19
20
  from wrapt import ObjectProxy
20
21
 
21
22
  from opentelemetry import context, trace
22
23
 
23
- # pylint: disable=unused-import
24
24
  # pylint: disable=E0611
25
- from opentelemetry.context import _SUPPRESS_INSTRUMENTATION_KEY # noqa: F401
25
+ # FIXME: fix the importing of these private attributes when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.=
26
+ from opentelemetry.context import (
27
+ _SUPPRESS_HTTP_INSTRUMENTATION_KEY,
28
+ _SUPPRESS_INSTRUMENTATION_KEY,
29
+ )
30
+
31
+ # pylint: disable=E0611
26
32
  from opentelemetry.propagate import extract
27
33
  from opentelemetry.trace import StatusCode
28
34
  from opentelemetry.trace.propagation.tracecontext import (
@@ -152,3 +158,42 @@ def _python_path_without_directory(python_path, directory, path_separator):
152
158
  "",
153
159
  python_path,
154
160
  )
161
+
162
+
163
+ def is_instrumentation_enabled() -> bool:
164
+ if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
165
+ return False
166
+ return True
167
+
168
+
169
+ def is_http_instrumentation_enabled() -> bool:
170
+ return is_instrumentation_enabled() and not context.get_value(
171
+ _SUPPRESS_HTTP_INSTRUMENTATION_KEY
172
+ )
173
+
174
+
175
+ @contextmanager
176
+ def _suppress_instrumentation(*keys: str) -> Iterable[None]:
177
+ """Suppress instrumentation within the context."""
178
+ ctx = context.get_current()
179
+ for key in keys:
180
+ ctx = context.set_value(key, True, ctx)
181
+ token = context.attach(ctx)
182
+ try:
183
+ yield
184
+ finally:
185
+ context.detach(token)
186
+
187
+
188
+ @contextmanager
189
+ def suppress_instrumentation() -> Iterable[None]:
190
+ """Suppress instrumentation within the context."""
191
+ with _suppress_instrumentation(_SUPPRESS_INSTRUMENTATION_KEY):
192
+ yield
193
+
194
+
195
+ @contextmanager
196
+ def suppress_http_instrumentation() -> Iterable[None]:
197
+ """Suppress instrumentation within the context."""
198
+ with _suppress_instrumentation(_SUPPRESS_HTTP_INSTRUMENTATION_KEY):
199
+ yield
@@ -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.43b0"
15
+ __version__ = "0.45b0"