diff --git a/ansible/install/elk.yml b/ansible/install/elk.yml index f3f82f370..23480ff2a 100644 --- a/ansible/install/elk.yml +++ b/ansible/install/elk.yml @@ -13,3 +13,8 @@ - { role: nginx } - { role: curator, when: install_curator_tool } - { role: kibana } + +- hosts: localhost + remote_user: "{{ local_remote_user }}" + roles: + - { role: es-template } diff --git a/ansible/install/es-template.yml b/ansible/install/es-template.yml new file mode 100644 index 000000000..1cdc68b99 --- /dev/null +++ b/ansible/install/es-template.yml @@ -0,0 +1,6 @@ +--- + +- hosts: localhost + remote_user: "{{ local_remote_user }}" + roles: + - { role: es-template } diff --git a/ansible/install/roles/es-template/tasks/main.yml b/ansible/install/roles/es-template/tasks/main.yml new file mode 100644 index 000000000..f47984f65 --- /dev/null +++ b/ansible/install/roles/es-template/tasks/main.yml @@ -0,0 +1,11 @@ +--- + +- name: Upload templates + uri: + url: http://{{ es_ip }}:{{ es_local_port }}/_template/{{ item | basename | regex_replace('\.json','') }}* + method: PUT + body: "{{ lookup('file', item) }}" + body_format: json + with_fileglob: + - "{{ browbeat_path }}/elastic/templates/browbeat*" + ignore_errors: true diff --git a/elastic/README.rst b/elastic/README.rst new file mode 100644 index 000000000..22bd714b7 --- /dev/null +++ b/elastic/README.rst @@ -0,0 +1,14 @@ +ElasticSearch Configuration for Browbeat +----------------------------------------- + +**+ templates/** + +Will contain Elasticsearch templates to account for things like the Browbeat UUID. +These Templates will be installed if you run through our Elasticsearch installer. If +you already have a Elasticsearch Host, you can install them by running the following:: + + $ cd ../ansible + $ vi install/group_vars/all.yml + # Update your es_ip + $ ansible-playbook -i hosts install/es-template.yml + diff --git a/elastic/templates/README.rst b/elastic/templates/README.rst new file mode 100644 index 000000000..249ff749e --- /dev/null +++ b/elastic/templates/README.rst @@ -0,0 +1,4 @@ +ElasticSearch / Kibana Template +---------------------------------- + +Template to instruct elasticSearch & Kibana to not processes some of our fields. For example, our UUIDs would turn into multiple strings due the default tokenizer's use of '-', '.', '/', etc. as token separators. diff --git a/elastic/templates/browbeat-perfkit-.json b/elastic/templates/browbeat-perfkit-.json new file mode 100644 index 000000000..e9eed6b0d --- /dev/null +++ b/elastic/templates/browbeat-perfkit-.json @@ -0,0 +1,71 @@ +{ + template: "browbeat-perfkit-*", + mappings: { + result: { + properties: { + browbeat_rerun: { + type: "long" + }, + browbeat_scenario: { + properties: { + benchmarks: { + index: "not_analyzed", + type: "string" + } + } + }, + browbeat_uuid: { + index: "not_analyzed", + type: "string" + }, + cloud_name: { + index: "not_analyzed", + type: "string" + }, + grafana_url: { + properties: { + openstack-general-system-performance: { + index: "not_analyzed", + type: "string" + } + } + }, + perfkit_setup: { + properties: { + cloud: { + index: "not_analyzed", + type: "string" + }, + image: { + index: "not_analyzed", + type: "string" + }, + machine_instance: { + index: "not_analyzed", + type: "string" + }, + machine_type: { + index: "not_analyzed", + type: "string" + }, + perfkitbenchmarker_version: { + index: "not_analyzed", + type: "string" + }, + vm_count: { + type: "string" + }, + zone: { + index: "not_analyzed", + type: "string" + } + } + }, + timestamp: { + type: "date", + format: "strict_date_optional_time||epoch_millis" + } + } + } + } +} diff --git a/elastic/templates/browbeat-rally-.json b/elastic/templates/browbeat-rally-.json new file mode 100644 index 000000000..630a15c83 --- /dev/null +++ b/elastic/templates/browbeat-rally-.json @@ -0,0 +1,72 @@ +{ + template: "browbeat-rally-*", + mappings: { + result: { + properties: { + action: { + index: "not_analyzed", + type: "string" + }, + browbeat_uuid: { + index: "not_analyzed", + type: "string" + }, + cloud_name: { + index: "not_analyzed", + type: "string" + }, + grafana_url: { + properties: { + openstack-general-system-performance: { + index: "not_analyzed", + type: "string" + } + } + }, + result: { + type: "string" + }, + scenario: { + index: "not_analyzed", + type: "string" + }, + timestamp: { + type: "date", + format: "strict_date_optional_time||epoch_millis" + } + } + }, + error: { + properties: { + action: { + index: "not_analyzed", + type: "string" + }, + action_name: { + index: "not_analyzed", + type: "string" + }, + browbeat_uuid: { + index: "not_analyzed", + type: "string" + }, + cloud_name: { + index: "not_analyzed", + type: "string" + }, + error_msg: { + index: "not_analyzed", + type: "string" + }, + error_type: { + index: "not_analyzed", + type: "string" + }, + timestamp: { + type: "date", + format: "strict_date_optional_time||epoch_millis" + } + } + } + } +} diff --git a/elastic/templates/browbeat-shaker-.json b/elastic/templates/browbeat-shaker-.json new file mode 100644 index 000000000..8dd95a61b --- /dev/null +++ b/elastic/templates/browbeat-shaker-.json @@ -0,0 +1,112 @@ +{ + aliases: { }, + template: "browbeat-shaker-*", + mappings: { + result: { + properties: { + browbeat_scenario: { + index: "not_analyzed", + type: "string" + }, + browbeat_uuid: { + index: "not_analyzed", + type: "string" + }, + cloud_name: { + index: "not_analyzed", + type: "string" + }, + grafana_url: { + properties: { + openstack-general-system-performance: { + index: "not_analyzed", + type: "string" + } + } + }, + result: { + properties: { + metric: { + index: "not_analyzed", + type: "string" + }, + result_type: { + index: "not_analyzed", + type: "string" + }, + value: { + type: "double" + } + } + }, + run: { + type: "long" + }, + shaker_test_info: { + properties: { + deployment: { + properties: { + template: { + index: "not_analyzed", + type: "string" + } + } + }, + description: { + index: "not_analyzed", + type: "string" + }, + execution: { + properties: { + progression: { + index: "not_analyzed", + type: "string" + }, + tests: { + properties: { + class: { + index: "not_analyzed", + type: "string" + }, + method: { + index: "not_analyzed", + type: "string" + }, + time: { + index: "not_analyzed", + type: "long" + }, + title: { + index: "not_analyzed", + type: "string" + } + } + } + } + }, + file_name: { + index: "not_analyzed", + type: "string" + }, + title: { + index: "not_analyzed", + type: "string" + } + } + }, + shaker_uuid: { + index: "not_analyzed", + type: "string" + }, + template: { + index: "not_analyzed", + type: "string" + }, + timestamp: { + type: "date", + format: "dateOptionalTime" + } + } + } + } +}