* set "publish_region" config value from
variable "$REGION_NAME"
* set default "publish_kafka_project_id"
to "mini-mon" instead of "admin"
* update the systemd service unit file
since that file is created by devstack's
"run_process" function
- set KillMode to 'control-group', since
monasca-tranform generates several
child process
* remove monasca-transform.service file
since its now being generated by devstack
plugin.
Change-Id: I6654b7973f8502d4805d25c96b2038291e398552
Story: 2001815
Task: 14328
Following changes were required:
1.)
By default the pre-built distribution
for Spark 2.2.0 is compiled with Scala 2.11.
monasca-transform requires Spark compiled with
Scala 2.10 since we use spark streaming to
pull data from Kafka and the version of Kafka
is compatible with Scala 2.10.
The recommended way is to compile Spark
with Scala 2.10, but for purposes of devstack
plugin made changes to pull the required jars
from mvn directly.
(see SPARK_JARS and SPARK_JAVA_LIB variables in
settings)
All jars get moved to
<SPARK_HOME>/assembly/target/assembly/
target/scala_2.10/jars/
Note: <SPARK_HOME>/jars gets renamed
to <SPARK_HOME>/jars_original.
spark-submit defaults to assembly location
if <SPARK_HOME>/jars directory is missing.
2.) Updated start up scripts for spark
worker and spark master with a new env variable
SPARK_SCALA_VERSIOn=2.10. Also updated
PYTHONPATH variable to add new
py4j-0.10.4-src.zip file
3.) Some changes to adhere to deprecated pyspark
function calls which were removed in Spark 2.0
Change-Id: I8f8393bb91307d55f156b2ebf45225a16ae9d8f4
in /var/run/spark
Enable spark configuration to rotate logs
in /var/run/spark directory and keep minimum
set of files on devstack environment.
Change-Id: I6d2c46d4ec53475e49f5bff6f2b82dccc0d01bbf
With this change pre hourly processor which does the
hourly aggregation (second stage) and writes the
final aggregated metrics to metris topic in kafka
now accounts for any early arriving metrics.
This change along with two previous changes
to pre hourly processor that added
1.) configurable late metrics slack time
(https://review.openstack.org/#/c/394497/), and
2.) batch filtering
(https://review.openstack.org/#/c/363100/)
will make sure all late arriving or early
arriving metrics for an hour are aggregated
appropriately.
Also made improvement in MySQL offset to call
delete excess revisions only once.
Change-Id: I919cddf343821fe52ad6a1d4170362311f84c0e4
We have seen several instances where Spark 1.6.1 over time
continues to consume more and more resources.
The change Ibf244cbfc00a90ada66f492b473719c25fa17fd2 was not
enough alone to curb this growth, but the new version of Spark
has shown better behavior.
Related changes will also need to be done in any installer,
such as Ansible.
Change-Id: Ib6b1220cf0186def115846c8cf71684bb2d6e8c7
Prevent creating a new spark sql context object with every batch.
Profiling of java heap for the driver indicated that there is a
steady increase (~12MB over 5 days) of
org.apache.spark.sql.execution.metric.LongSQLMetricValue
and org.apache.spark.sql.execution.ui.SQLTaskMetrics with
each batch execution. These are used by the spark streaming
ui and were not being garbage collected.
See https://issues.apache.org/jira/browse/SPARK-17381
with a similar issue.
This change along with setting
spark.sql.ui.retainedExecutions to a low number in
sparks-defaults.conf will reduce gradual increase in heap
size.
Also made a change to catch unhandled MemberNotJoined exception
because of whichthe transform service thread went into
a unresponsive state.
Change-Id: Ibf244cbfc00a90ada66f492b473719c25fa17fd2
The devstack plugin carries usage of `sudo -u` which doesn't seem to
work in the ci environment. Replace it with sudo followed by
appropriate permissions changes.
Use ${DEST} instead of literal /opt/stack to fit with gate usage.
Enabled monasca-api plugin in the settings and the required monasca
services along with zookeeper.
Change-Id: I6effede4ac9a2faf1c44eff9cd96bbf9c924d703
Added configuration option to allow the pre-hourly transformation to be
done at a specified period past the hour. This includes a check to
ensure that if not done yet for the hour but overdue processing is done
at the earliest time.
Change-Id: I8882f3089ca748ce435b4e9a92196a72a0a8e63f
This needs to be the admin project id so for devstack this needs to be written
to the configuration file once the users/projects etc are created and
identifiable.
Add a similar process to the refresh script.
Correct the configuration property name to 'project' rather than using the old
nomencature 'tenant'.
Change-Id: Ib9970ffacf5ee0f7f006722038a1db8024c1385e
There is a variable that tells what is the database (mysql)
password. However plugin.sh is using a hardcoded password.
Commits provides using DATABASE_PASSWORD variable (the same
one as devstack is using) + defines a variable for m-transform
user - MONASCA_TRANSFORM_DB_PASSWORD
Change-Id: I9fc8296ef31b22564f2cf1536e51ab3abc8c9dc9
Made changes such that debug-level log entries are written to
the application log noting which aggregated metrics are submitted
during pre-hourly and hourly processing.
Change-Id: I64c6a18233614fe680aa0b084570ee7885f316e5
The log file was being duplicated at monasca-transform.log and
monasca_transform.log. Fixed this to be set simply at
monasca-transform.log.
Change-Id: I6a63737c569b06a271e11b880675edadfbdcc250
Breaking down the aggregation into two stages.
The first stage aggregates raw metrics frequently and is
implemented as a Spark Streaming job which
aggregates metrics at a configurable time interval
(defaults to 10 minutes) and writes the intermediate
aggregated data, or instance usage data
to new "metrics_pre_hourly" kafka topic.
The second stage is implemented
as a batch job using Spark Streaming createRDD
direct stream batch API, which is triggered by the
first stage only when first stage runs at the
top of the hour.
Also enhanced kafka offsets table to keep track
of offsets from two stages along with streaming
batch time, last time version row got updated
and revision number. By default it should keep
last 10 revisions to the offsets for each
application.
Change-Id: Ib2bf7df6b32ca27c89442a23283a89fea802d146
Allow spark to configure the location of spark-events.
Add spark events log config to spark-defaults in devstack plugin.
Move spark events logging to /var/log/spark/events for devstack plugin.
Set group permissions to ensure spark events log directory is group, but not
world writable.
Change-Id: I26aef23a9a801a02a20e14899e1c89b10556e4d4
Spark could feasibly be installed in any location so we should
allow SPARK_HOME to be specified in the conf file and that
value used in the spark-submit carried out in the transform
service invocation.
Change-Id: I4d25ccaa0e271eeb783d186666cdc8aaf131097c
apache download source to use the archive site to ensure that
the dependency package does not disappear. Also brought the
vagrant environment inline with monasca-api (i.e., use the
same values for private network, add substitution for kafka
brokers ip address to the conf). Also parameterised
dependency sources (i.e., added settings to parameterise the
maven and apache repositories for the devstack plugin).
Change-Id: If9f0e2ed16bbfcd62152d29e5c7c86f5d555f9aa
The monasca-transform is a new component in Monasca that
aggregates and transforms metrics.
monasca-transform is a Spark based data driven aggregation
engine which collects, groups and aggregates existing individual
Monasca metrics according to business requirements and publishes
new transformed (derived) metrics to the Monasca Kafka queue.
Since the new transformed metrics are published as any other
metric in Monasca, alarms can be set and triggered on the
transformed metric, just like any other metric.
Co-Authored-By: Flint Calvin <flint.calvin@hp.com>
Co-Authored-By: David Charles Kennedy <david.c.kennedy@hpe.com>
Co-Authored-By: Ashwin Agate <ashwin.agate@hp.com>
Implements: blueprint monasca-transform
Change-Id: I0e67ac7a4c9a5627ddaf698855df086d55a52d26