Skip to content

Commit

Permalink
Rename _beat directories to _meta (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and tsg committed Jun 15, 2016
1 parent 7397fd5 commit 6003861
Show file tree
Hide file tree
Showing 124 changed files with 58 additions and 57 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ update:
.PHONY: clean
clean:
$(foreach var,$(PROJECTS),$(MAKE) -C $(var) clean || exit 1;)
$(MAKE) -C generate/beat clean
$(MAKE) -C generate/metricbeat/metricset clean

.PHONY: check
check:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ update: python-env
# Update config
echo "Update config file"
-rm -f etc/${BEATNAME}.yml
cat etc/beat.yml ${ES_BEATS}/libbeat/_beat/config.yml | sed -e "s/beatname/${BEATNAME}/g" > ${BEATNAME}.yml
cat etc/beat.yml ${ES_BEATS}/libbeat/_meta/config.yml | sed -e "s/beatname/${BEATNAME}/g" > ${BEATNAME}.yml
-rm -f etc/${BEATNAME}.full.yml
cat etc/beat.full.yml ${ES_BEATS}/libbeat/_beat/config.full.yml | sed -e "s/beatname/${BEATNAME}/g" > ${BEATNAME}.full.yml
cat etc/beat.full.yml ${ES_BEATS}/libbeat/_meta/config.full.yml | sed -e "s/beatname/${BEATNAME}/g" > ${BEATNAME}.full.yml

# Update fields
echo "Update fields"
Expand Down
2 changes: 1 addition & 1 deletion libbeat/scripts/generate_fields_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def fields_to_asciidoc(input, output, beat):
fields = f.read()

# Prepends beat fields from libbeat
with open(es_beats + "/libbeat/_beat/fields.yml") as f:
with open(es_beats + "/libbeat/_meta/fields.yml") as f:
fields = f.read() + fields

output = open(beat_path + "/docs/fields.asciidoc", 'w')
Expand Down
2 changes: 1 addition & 1 deletion libbeat/scripts/generate_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def fill_field_properties(args, field, defaults, path):
fields = f.read()

# Prepend beat fields from libbeat
with open(args.es_beats + "/libbeat/_beat/fields.yml") as f:
with open(args.es_beats + "/libbeat/_meta/fields.yml") as f:
fields = f.read() + fields

with open(target, 'w') as output:
Expand Down
2 changes: 1 addition & 1 deletion libbeat/tests/system/beat/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def extract_fields(doc_list, name):
# TODO: Make fields_doc path more generic to work with beat-generator
with open(fields_doc, "r") as f:
# TODO: Make this path more generic to work with beat-generator.
with open("../../../libbeat/_beat/fields.yml") as f2:
with open("../../../libbeat/_meta/fields.yml") as f2:
content = f2.read()

content += f.read()
Expand Down
2 changes: 1 addition & 1 deletion libbeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_config_test(self):
"""
Checks if -configtest works as expected
"""
shutil.copy("../../_beat/config.yml",
shutil.copy("../../_meta/config.yml",
os.path.join(self.working_dir, "libbeat.yml"))
with open(self.working_dir + "/beatname.template.json", "w") as f:
f.write('{"template": true}')
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ include ${ES_BEATS}/libbeat/scripts/Makefile
kibana:
-rm -r etc/kibana
mkdir -p etc/kibana
-cp -r module/*/_beat/kibana/ etc/kibana
-cp -r module/*/_meta/kibana/ etc/kibana

# Collects all module and metricset fields
.PHONY: fields
fields:
mkdir -p etc/
cat ${ES_BEATS}/metricbeat/etc/_beat/fields_base.yml > etc/fields.yml
cat ${ES_BEATS}/metricbeat/etc/_meta/fields_base.yml > etc/fields.yml
. ${PYTHON_ENV}/bin/activate; python ${ES_BEATS}/metricbeat/scripts/fields_collector.py >> etc/fields.yml

# Collects all module docs
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ kibana:

# Modules
apache:
build: ${PWD}/module/apache/_beat
build: ${PWD}/module/apache/_meta

mysql:
image: mysql:5.7.10
environment:
- MYSQL_ROOT_PASSWORD=test

nginx:
build: ${PWD}/module/nginx/_beat
build: ${PWD}/module/nginx/_meta

redis:
image: redis:3.2.0
Expand Down
7 changes: 3 additions & 4 deletions metricbeat/docs/developer-guide/create-metricset.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ in debug mode with
The MetricSet which was generated with its files can be found under `module/{module}/{metricset}`. This directory contains
the following files:


* \{metricset}.go
* _beat/docs.asciidoc
* _beat/data.json
* _beat/fields.yml
* _meta/docs.asciidoc
* _meta/data.json
* _meta/fields.yml

We will looking at each file in more detail below.

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/docs/developer-guide/create-module.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Metricbeat modules are used to group multiple metricsets together and to impleme
of the MetricSets. In most cases, no implementation of the module is needed and the default module
implementation is automatically picked.

It is important to complete the configuration and documentation files for a module. All these files are in the `_beat`
It is important to complete the configuration and documentation files for a module. All these files are in the `_meta`
directory and a default version is generate when using `make create-metricset`.

[float]
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/apache/status.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-apache-status]]
include::../../../module/apache/status/_beat/docs.asciidoc[]
include::../../../module/apache/status/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/apache/status/_beat/data.json[]
include::../../../module/apache/status/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/mysql/status.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-mysql-status]]
include::../../../module/mysql/status/_beat/docs.asciidoc[]
include::../../../module/mysql/status/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/mysql/status/_beat/data.json[]
include::../../../module/mysql/status/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/nginx/stubstatus.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-nginx-stubstatus]]
include::../../../module/nginx/stubstatus/_beat/docs.asciidoc[]
include::../../../module/nginx/stubstatus/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/nginx/stubstatus/_beat/data.json[]
include::../../../module/nginx/stubstatus/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/redis/info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-redis-info]]
include::../../../module/redis/info/_beat/docs.asciidoc[]
include::../../../module/redis/info/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/redis/info/_beat/data.json[]
include::../../../module/redis/info/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/redis/keyspace.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-redis-keyspace]]
include::../../../module/redis/keyspace/_beat/docs.asciidoc[]
include::../../../module/redis/keyspace/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/redis/keyspace/_beat/data.json[]
include::../../../module/redis/keyspace/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/core.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-core]]
include::../../../module/system/core/_beat/docs.asciidoc[]
include::../../../module/system/core/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/core/_beat/data.json[]
include::../../../module/system/core/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/cpu.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-cpu]]
include::../../../module/system/cpu/_beat/docs.asciidoc[]
include::../../../module/system/cpu/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/cpu/_beat/data.json[]
include::../../../module/system/cpu/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/diskio.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-diskio]]
include::../../../module/system/diskio/_beat/docs.asciidoc[]
include::../../../module/system/diskio/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/diskio/_beat/data.json[]
include::../../../module/system/diskio/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/filesystem.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-filesystem]]
include::../../../module/system/filesystem/_beat/docs.asciidoc[]
include::../../../module/system/filesystem/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/filesystem/_beat/data.json[]
include::../../../module/system/filesystem/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/fsstat.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-fsstat]]
include::../../../module/system/fsstat/_beat/docs.asciidoc[]
include::../../../module/system/fsstat/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/fsstat/_beat/data.json[]
include::../../../module/system/fsstat/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/memory.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-memory]]
include::../../../module/system/memory/_beat/docs.asciidoc[]
include::../../../module/system/memory/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/memory/_beat/data.json[]
include::../../../module/system/memory/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/network.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-network]]
include::../../../module/system/network/_beat/docs.asciidoc[]
include::../../../module/system/network/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/network/_beat/data.json[]
include::../../../module/system/network/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/system/process.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-system-process]]
include::../../../module/system/process/_beat/docs.asciidoc[]
include::../../../module/system/process/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/system/process/_beat/data.json[]
include::../../../module/system/process/_meta/data.json[]
----
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/zookeeper/mntr.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-zookeeper-mntr]]
include::../../../module/zookeeper/mntr/_beat/docs.asciidoc[]
include::../../../module/zookeeper/mntr/_meta/docs.asciidoc[]


==== Fields
Expand All @@ -15,5 +15,5 @@ Below is an example document generated by this metricset.

[source,json]
----
include::../../../module/zookeeper/mntr/_beat/data.json[]
include::../../../module/zookeeper/mntr/_meta/data.json[]
----
File renamed without changes.
2 changes: 1 addition & 1 deletion metricbeat/mb/testing/data_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func createEvent(event common.MapStr, m mb.MetricSet) error {

output, _ := json.MarshalIndent(fullEvent, "", " ")

err = ioutil.WriteFile(path+"/_beat/data.json", output, 0644)
err = ioutil.WriteFile(path+"/_meta/data.json", output, 0644)
if err != nil {
return err
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion metricbeat/scripts/config_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def collect(beat_path, full=False):
# Iterate over all modules
for module in modules:

beat_path = path + "/" + module + "/_beat"
beat_path = path + "/" + module + "/_meta"

module_configs = beat_path + "/config.yml"

Expand Down
4 changes: 2 additions & 2 deletions metricbeat/scripts/create_metricset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def generate_metricset(base_path, metricbeat_path, module, metricset):

generate_module(base_path, metricbeat_path, module, metricset)
metricset_path = base_path + "/module/" + module + "/" + metricset
meta_path = metricset_path + "/_beat"
meta_path = metricset_path + "/_meta"

if os.path.isdir(metricset_path):
print "MericSet already exists. Skipping creating metricset " + metricset + ".\n"
Expand Down Expand Up @@ -42,7 +42,7 @@ def generate_metricset(base_path, metricbeat_path, module, metricset):
def generate_module(base_path, metricbeat_path, module, metricset):

module_path = base_path + "/module/" + module
meta_path = module_path + "/_beat"
meta_path = module_path + "/_meta"

if os.path.isdir(module_path):
print "Module already exists. Skipping creating module " + module + ".\n"
Expand Down
Loading

0 comments on commit 6003861

Please sign in to comment.