Make tracing of SQL statements configurable in DevStack plugin

This patch adds a new configuration variable OSPROFILER_TRACE_SQLALCHEMY
with default value `True`.

Change-Id: I72c782872dac370d6d1620cf734a293f998ed7f1
This commit is contained in:
Ilya Shakhat 2018-09-17 15:52:40 +02:00
parent 2b4786b5cc
commit 2f66049fb8
3 changed files with 10 additions and 1 deletions

View File

@ -80,3 +80,9 @@ that the default messaging driver is used.
Example: enable Redis collector::
OSPROFILER_COLLECTOR=redis
**OSPROFILER_TRACE_SQLALCHEMY** - controls tracing of SQL statements. If enabled,
all SQL statements processed by SQL Alchemy are added into traces. By default enabled.
Example: disable SQL statements tracing::
OSPROFILER_TRACE_SQLALCHEMY=False

View File

@ -71,7 +71,7 @@ function configure_osprofiler() {
if [ -f $conf ]
then
iniset $conf profiler enabled True
iniset $conf profiler trace_sqlalchemy True
iniset $conf profiler trace_sqlalchemy $OSPROFILER_TRACE_SQLALCHEMY
iniset $conf profiler hmac_keys $OSPROFILER_HMAC_KEYS
iniset $conf profiler connection_string $OSPROFILER_CONNECTION_STRING
fi

View File

@ -5,4 +5,7 @@
# requests that specify one of these keys in HTTP headers.
OSPROFILER_HMAC_KEYS=${OSPROFILER_HMAC_KEYS:-"SECRET_KEY"}
# Set whether tracing of SQL requests is enabled or not
OSPROFILER_TRACE_SQLALCHEMY="True"
enable_service osprofiler