Merge "Allow to use environment variable to override some metric values"

This commit is contained in:
Zuul 2018-09-13 08:46:00 +00:00 committed by Gerrit Code Review
commit 49ed45e01d
6 changed files with 24 additions and 8 deletions

View File

@ -55,6 +55,8 @@ function generate_telemetry_report(){
gnocchi resource show -t instance $instance_id
echo "* Gnocchi measures for instance ${instance_id}:"
gnocchi measures show -r $instance_id cpu_util
gnocchi metric show -r $instance_id cpu
gnocchi --debug measures show -r $instance_id --aggregation rate:mean cpu
done
gnocchi status

View File

@ -43,6 +43,7 @@
export DEVSTACK_LOCAL_CONFIG+=$'\n'"INSTALL_TEMPEST='False'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"CEILOMETER_BACKEND=gnocchi"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"GNOCCHI_ARCHIVE_POLICY=high"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"GNOCCHI_ARCHIVE_POLICY_TEMPEST=ceilometer-high"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"CEILOMETER_PIPELINE_INTERVAL=15"
function post_test_hook {
cd /opt/stack/new/telemetry-tempest-plugin/playbooks/legacy/telemetry-dsvm-integration-tempest-plugin/

View File

@ -60,8 +60,16 @@ TelemetryGroup = [
cfg.IntOpt('alarm_granularity',
default=300,
help="Granularity to use for aodh alarms. This must match the "
"configured Gnocchi archive policy")
"configured Gnocchi archive policy"),
cfg.StrOpt('alarm_metric_name',
default="cpu_util",
help="Name of the metric to create an alarm on."),
cfg.StrOpt('alarm_aggregation_method',
default="mean",
help="Aggregation method to use for alarm."),
cfg.IntOpt('alarm_threshold',
default=10,
help="Threshold to cross for the alarm to trigger."),
]
event_opts = [

View File

@ -42,11 +42,11 @@
"type": "OS::Ceilometer::GnocchiAggregationByResourcesAlarm",
"properties": {
"description": "Scale-up if the mean CPU > 10% on 1 minute",
"metric": "cpu_util",
"aggregation_method": "mean",
"metric": "$ENVIRON["CEILOMETER_METRIC_NAME"]",
"aggregation_method": "$ENVIRON["GNOCCHI_AGGREGATION_METHOD"]",
"granularity": $ENVIRON["AODH_GRANULARITY"],
"evaluation_periods": 1,
"threshold": 10,
"threshold": $ENVIRON["AODH_THRESHOLD"],
"comparison_operator": "gt",
"alarm_actions": [
{

View File

@ -41,11 +41,11 @@
"type": "OS::Ceilometer::GnocchiAggregationByResourcesAlarm",
"properties": {
"description": "Scale-down if the mean CPU > 10% on 1 minute",
"metric": "cpu_util",
"aggregation_method": "mean",
"metric": "$ENVIRON["CEILOMETER_METRIC_NAME"]",
"aggregation_method": "$ENVIRON["GNOCCHI_AGGREGATION_METHOD"]",
"granularity": $ENVIRON["AODH_GRANULARITY"],
"evaluation_periods": 1,
"threshold": 10,
"threshold": $ENVIRON["AODH_THRESHOLD"],
"comparison_operator": "gt",
"alarm_actions": [
{

View File

@ -82,6 +82,11 @@ class TestTelemetryIntegration(manager.ScenarioTest):
os.environ.update({
"ADMIN_TOKEN": admin_auth[0],
"USER_TOKEN": auth[0],
"CEILOMETER_METRIC_NAME":
config.CONF.telemetry.alarm_metric_name,
"GNOCCHI_AGGREGATION_METHOD":
config.CONF.telemetry.alarm_aggregation_method,
"AODH_THRESHOLD": str(config.CONF.telemetry.alarm_threshold),
"AODH_GRANULARITY": str(config.CONF.telemetry.alarm_granularity),
"AODH_SERVICE_URL": self._get_endpoint(auth, "alarming_plugin"),
"GNOCCHI_SERVICE_URL": self._get_endpoint(auth, "metric"),