diff options
author | Ilya Shakhat <shakhat@gmail.com> | 2019-05-15 16:47:25 +0200 |
---|---|---|
committer | Ilya Shakhat <shakhat@gmail.com> | 2019-05-16 12:03:00 +0200 |
commit | 0fcc65d0d5a9df40dc53fb611a6058e18a44c654 (patch) | |
tree | 8699630593a7a17f1ca309b85adb099b4e6afa59 /devstack | |
parent | 30049d6c901e9a36f8e1dd07bac3bdeadd20b550 (diff) | |
download | osprofiler-0fcc65d0d5a9df40dc53fb611a6058e18a44c654.tar.gz |
Automatic configuration of SQLAlchemy driver in DevStack
This patch adds a new type of collector "sqlalchemy".
To enable it, add the following line into DevStack local.conf:
OSPROFILER_COLLECTOR=sqlalchemy
OSProfiler DevStack plugin creates database for traces and
configures all services to use it.
SQLAlchemy driver is extend to be able to list traces.
Zuul job is added to run Tempest tests with sqlalchemy driver enabled.
Change-Id: Ia943d311d78f6dfd2e6bb884c8dca725b3b2a36b
Diffstat (limited to 'devstack')
-rw-r--r-- | devstack/README.rst | 2 | ||||
-rw-r--r-- | devstack/lib/osprofiler | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/devstack/README.rst b/devstack/README.rst index da83baf..7469f79 100644 --- a/devstack/README.rst +++ b/devstack/README.rst @@ -17,6 +17,7 @@ that control this: * ``<empty>`` - default messaging driver is used * ``redis`` - Redis is installed * ``jaeger`` - Jaeger is installed + * ``sqlalchemy`` - SQLAlchemy driver is installed The default value of ``OSPROFILER_CONNECTION_STRING`` is set automatically depending on ``OSPROFILER_COLLECTOR`` value. @@ -31,6 +32,7 @@ that control this: * ``mongodb://host:port`` - use MongoDB as trace storage * ``loginsight://username:password@host`` - use LogInsight as trace collector/storage * ``jaeger://host:port`` - use Jaeger as trace collector + * ``mysql+pymysql://username:password@host/profiler?charset=utf8`` - use SQLAlchemy driver with MySQL database To configure DevStack and enable OSProfiler edit ``${DEVSTACK_DIR}/local.conf`` diff --git a/devstack/lib/osprofiler b/devstack/lib/osprofiler index 8a7351b..aaa67f3 100644 --- a/devstack/lib/osprofiler +++ b/devstack/lib/osprofiler @@ -112,9 +112,15 @@ function install_osprofiler_collector() { elif [ "$OSPROFILER_COLLECTOR" == "mongodb" ]; then install_mongodb OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"mongodb://localhost:27017"} + elif [ "$OSPROFILER_COLLECTOR" == "sqlalchemy" ]; then + local db=`database_connection_url osprofiler` + OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-${db}} + recreate_database osprofiler else die $LINENO "OSProfiler collector $OSPROFILER_COLLECTOR is not supported" fi + + echo ${OSPROFILER_CONNECTION_STRING} > $HOME/.osprofiler_connection_string } function configure_osprofiler() { |