Skip to content

Commit 58521be

Browse files
authored
Update bootstrap cmd to use exact version when installing (#1722)
1 parent 4027dae commit 58521be

File tree

2 files changed

+43
-30
lines changed

2 files changed

+43
-30
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Adjust `B3Format` propagator to be spec compliant by not modifying context
1616
when propagation headers are not present/invalid/empty
1717
([#1728](https://github.com/open-telemetry/opentelemetry-python/pull/1728))
18+
- Update bootstrap cmd to use exact version when installing instrumentation packages.
19+
([#1722](https://github.com/open-telemetry/opentelemetry-python/pull/1722))
1820

1921

2022
## [1.0.0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.0.0) - 2021-03-26

opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py

+41-30
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import sys
2121
from logging import getLogger
2222

23+
from opentelemetry.instrumentation.version import __version__ as version
24+
2325
logger = getLogger(__file__)
2426

2527

@@ -32,36 +34,45 @@
3234
# the libraries their application uses to figure which one can be
3335
# instrumented.
3436
# NOTE: system-metrics is not to be included.
35-
instrumentations = {
36-
"aiohttp-client": "opentelemetry-instrumentation-aiohttp-client>=0.15b0",
37-
"aiopg": "opentelemetry-instrumentation-aiopg>=0.15b0",
38-
"asyncpg": "opentelemetry-instrumentation-asyncpg>=0.11b0",
39-
"boto": "opentelemetry-instrumentation-boto>=0.11b0",
40-
"botocore": "opentelemetry-instrumentation-botocore>=0.11b0",
41-
"celery": "opentelemetry-instrumentation-celery>=0.11b0",
42-
"dbapi": "opentelemetry-instrumentation-dbapi>=0.8b0",
43-
"django": "opentelemetry-instrumentation-django>=0.8b0",
44-
"elasticsearch": "opentelemetry-instrumentation-elasticsearch>=0.11b0",
45-
"falcon": "opentelemetry-instrumentation-falcon>=0.13b0",
46-
"fastapi": "opentelemetry-instrumentation-fastapi>=0.11b0",
47-
"flask": "opentelemetry-instrumentation-flask>=0.8b0",
48-
"grpc": "opentelemetry-instrumentation-grpc>=0.8b0",
49-
"jinja2": "opentelemetry-instrumentation-jinja2>=0.8b0",
50-
"mysql": "opentelemetry-instrumentation-mysql>=0.8b0",
51-
"psycopg2": "opentelemetry-instrumentation-psycopg2>=0.8b0",
52-
"pymemcache": "opentelemetry-instrumentation-pymemcache>=0.11b0",
53-
"pymongo": "opentelemetry-instrumentation-pymongo>=0.8b0",
54-
"pymysql": "opentelemetry-instrumentation-pymysql>=0.8b0",
55-
"pyramid": "opentelemetry-instrumentation-pyramid>=0.11b0",
56-
"redis": "opentelemetry-instrumentation-redis>=0.8b0",
57-
"requests": "opentelemetry-instrumentation-requests>=0.8b0",
58-
"sklearn": "opentelemetry-instrumentation-sklearn>=0.15b0",
59-
"sqlalchemy": "opentelemetry-instrumentation-sqlalchemy>=0.8b0",
60-
"sqlite3": "opentelemetry-instrumentation-sqlite3>=0.11b0",
61-
"starlette": "opentelemetry-instrumentation-starlette>=0.11b0",
62-
"tornado": "opentelemetry-instrumentation-tornado>=0.13b0",
63-
"urllib": "opentelemetry-instrumentation-urllib>=0.17b0",
64-
}
37+
def all_instrumentations():
38+
pkg_instrumentation_map = {
39+
"aiohttp-client": "opentelemetry-instrumentation-aiohttp-client",
40+
"aiopg": "opentelemetry-instrumentation-aiopg",
41+
"asyncpg": "opentelemetry-instrumentation-asyncpg",
42+
"boto": "opentelemetry-instrumentation-boto",
43+
"botocore": "opentelemetry-instrumentation-botocore",
44+
"celery": "opentelemetry-instrumentation-celery",
45+
"dbapi": "opentelemetry-instrumentation-dbapi",
46+
"django": "opentelemetry-instrumentation-django",
47+
"elasticsearch": "opentelemetry-instrumentation-elasticsearch",
48+
"falcon": "opentelemetry-instrumentation-falcon",
49+
"fastapi": "opentelemetry-instrumentation-fastapi",
50+
"flask": "opentelemetry-instrumentation-flask",
51+
"grpc": "opentelemetry-instrumentation-grpc",
52+
"jinja2": "opentelemetry-instrumentation-jinja2",
53+
"mysql": "opentelemetry-instrumentation-mysql",
54+
"psycopg2": "opentelemetry-instrumentation-psycopg2",
55+
"pymemcache": "opentelemetry-instrumentation-pymemcache",
56+
"pymongo": "opentelemetry-instrumentation-pymongo",
57+
"pymysql": "opentelemetry-instrumentation-pymysql",
58+
"pyramid": "opentelemetry-instrumentation-pyramid",
59+
"redis": "opentelemetry-instrumentation-redis",
60+
"requests": "opentelemetry-instrumentation-requests",
61+
"sklearn": "opentelemetry-instrumentation-sklearn",
62+
"sqlalchemy": "opentelemetry-instrumentation-sqlalchemy",
63+
"sqlite3": "opentelemetry-instrumentation-sqlite3",
64+
"starlette": "opentelemetry-instrumentation-starlette",
65+
"tornado": "opentelemetry-instrumentation-tornado",
66+
"urllib": "opentelemetry-instrumentation-urllib",
67+
}
68+
for pkg, instrumentation in pkg_instrumentation_map.items():
69+
pkg_instrumentation_map[pkg] = "{0}=={1}".format(
70+
instrumentation, version
71+
)
72+
return pkg_instrumentation_map
73+
74+
75+
instrumentations = all_instrumentations()
6576

6677
# relevant instrumentors and tracers to uninstall and check for conflicts for target libraries
6778
libraries = {

0 commit comments

Comments
 (0)