-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy path__init__.py
More file actions
31 lines (23 loc) · 769 Bytes
/
__init__.py
File metadata and controls
31 lines (23 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import importlib
import logging
from scout_apm.core.config import scout_config
logger = logging.getLogger(__name__)
instrument_names = [
"aioredis",
"asyncio",
"elasticsearch",
"jinja2",
"pymongo",
"redis",
"urllib3",
]
def ensure_all_installed():
disabled_instruments = scout_config.value("disabled_instruments")
for instrument_name in instrument_names:
if instrument_name in disabled_instruments:
logger.info("%s instrument is disabled. Skipping.", instrument_name)
continue
module = importlib.import_module("{}.{}".format(__name__, instrument_name))
module.ensure_installed()