diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 70c64a36ac0e..c09a563592b8 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -2,37 +2,122 @@ This file is generated! See scripts/docs_collector.py //// - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - * <> - +[options="header"] +|======================== +|Modules |Metricsets +|<> beta[] | +.1+| |<> beta[] +|<> | +.1+| |<> +|<> beta[] | +.6+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] | +.3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] | +.8+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] | +.1+| |<> beta[] +|<> beta[] | +.2+| |<> beta[] +|<> beta[] +|<> beta[] | +.3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> experimental[] | +.2+| |<> experimental[] +|<> experimental[] +|<> beta[] | +.1+| |<> beta[] +|<> | +.2+| |<> +|<> +|<> beta[] | +.2+| |<> beta[] +|<> experimental[] +|<> beta[] | +.1+| |<> beta[] +|<> beta[] | +.2+| |<> beta[] +|<> beta[] +|<> beta[] | +.1+| |<> beta[] +|<> beta[] | +.11+| |<> beta[] +|<> experimental[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> experimental[] | +.2+| |<> experimental[] +|<> experimental[] +|<> beta[] | +.1+| |<> beta[] +|<> beta[] | +.2+| |<> beta[] +|<> beta[] +|<> | +.1+| |<> +|<> | +.1+| |<> +|<> beta[] | +.1+| |<> beta[] +|<> | +.3+| |<> +|<> +|<> +|<> beta[] | +.2+| |<> beta[] +|<> beta[] +|<> beta[] | +.2+| |<> beta[] +|<> beta[] +|<> | +.2+| |<> +|<> +|<> | +.12+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] +|<> +|<> beta[] | +.3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] | +.2+| |<> beta[] +|<> beta[] +|<> | +.1+| |<> +|================================ -- diff --git a/metricbeat/scripts/docs_collector.py b/metricbeat/scripts/docs_collector.py index a4e93c5af30e..85ae923e6cee 100644 --- a/metricbeat/scripts/docs_collector.py +++ b/metricbeat/scripts/docs_collector.py @@ -53,7 +53,10 @@ def collect(beat_name): with open(module_doc) as f: module_file += f.read() - modules_list[module] = title + modules_list[module] = {} + modules_list[module]["title"] = title + modules_list[module]["release"] = release + modules_list[module]["metricsets"] = {} config_file = beat_path + "/config.yml" @@ -103,6 +106,10 @@ def collect(beat_name): link = "<<" + link_name + "," + metricset + ">>" reference = "[[" + link_name + "]]" + modules_list[module]["metricsets"][metricset] = {} + modules_list[module]["metricsets"][metricset]["title"] = metricset + modules_list[module]["metricsets"][metricset]["link"] = link + module_links += "* " + link + "\n\n" module_includes += "include::" + module + "/" + metricset + ".asciidoc[]\n\n" @@ -126,6 +133,8 @@ def collect(beat_name): if release != "ga": metricset_file += "{}[]\n\n".format(get_release(metricset_fields)) + modules_list[module]["metricsets"][metricset]["release"] = release + metricset_file += 'include::../../../module/' + module + '/' + metricset + '/_meta/docs.asciidoc[]' + "\n" # TODO: This should point directly to the exported fields of the metricset, not the whole module @@ -162,12 +171,36 @@ def collect(beat_name): f.write(module_file) module_list_output = generated_note - for m, title in sorted(six.iteritems(modules_list)): - module_list_output += " * <>\n" + + module_list_output += '[options="header"]\n' + module_list_output += '|========================\n' + module_list_output += '|Modules |Metricsets \n' + + for key, m in sorted(six.iteritems(modules_list)): + + release_label = "" + if m["release"] != "ga": + release_label = m["release"] + "[]" + + module_list_output += '|{} {} |{} \n'.format("<> ", release_label, "") + + # Make sure empty entry row spans over all metricset rows for this module + module_list_output += '.{}+| '.format(len(m["metricsets"])) + + for key, ms in sorted(six.iteritems(m["metricsets"])): + + release_label = "" + if ms["release"] != "ga": + release_label = ms["release"] + "[]" + + module_list_output += '|{} {} \n'.format(ms["link"], release_label) + + module_list_output += '|================================' module_list_output += "\n\n--\n\n" - for m, title in sorted(six.iteritems(modules_list)): - module_list_output += "include::modules/" + m + ".asciidoc[]\n" + for key, m in sorted(six.iteritems(modules_list)): + module_list_output += "include::modules/" + key + ".asciidoc[]\n" # Write module link list with open(os.path.abspath("docs") + "/modules_list.asciidoc", 'w') as f: