@cryptotaxi247 / netdata-1 / commits / 10f5b2546

fix journal help and mark debug keys in the output (#16133)

* fix journal help and mark debug keys in the output * updated help

Costa Tsaousis committed Oct 5, 2023 at 15:37 UTC 10f5b2546938de79e2f7175a99ca2528ddf31a69
2 files changed +16 -21
collectors/systemd-journal.plugin/systemd-journal.c
+15 -20
@@ -1307,30 +1307,32 @@ static void netdata_systemd_journal_function_help(const char *transaction) {
1307 " "JOURNAL_PARAMETER_HELP"\n"
1308 " Shows this help message.\n"
1309 "\n"
1310 - " "JOURNAL_PARAMETER_ID":STRING\n"
1311 - " Caller supplied unique ID of the request.\n"
1312 - " This can be used later to request a progress report of the query.\n"
1313 - " Optional, but if omitted no `"JOURNAL_PARAMETER_PROGRESS"` can be requested.\n"
1314 - "\n"
1310 " "JOURNAL_PARAMETER_INFO"\n"
1311 " Request initial configuration information about the plugin.\n"
1312 " The key entity returned is the required_params array, which includes\n"
1313 " all the available systemd journal sources.\n"
1314 " When `"JOURNAL_PARAMETER_INFO"` is requested, all other parameters are ignored.\n"
1315 "\n"
1321 - " "JOURNAL_PARAMETER_DELTA"\n"
1322 - " When doing data queries, include deltas for histogram and facets.\n"
1323 - "\n"
1324 - " "JOURNAL_PARAMETER_TAIL"\n"
1325 - " Do a tail query, to return the newest items between the anchor and before.\n"
1316 + " "JOURNAL_PARAMETER_ID":STRING\n"
1317 + " Caller supplied unique ID of the request.\n"
1318 + " This can be used later to request a progress report of the query.\n"
1319 + " Optional, but if omitted no `"JOURNAL_PARAMETER_PROGRESS"` can be requested.\n"
1320 "\n"
1321 " "JOURNAL_PARAMETER_PROGRESS"\n"
1322 " Request a progress report (the `id` of a running query is required).\n"
1323 " When `"JOURNAL_PARAMETER_PROGRESS"` is requested, only parameter `"JOURNAL_PARAMETER_ID"` is used.\n"
1324 "\n"
1331 - " "JOURNAL_PARAMETER_DATA_ONLY"\n"
1325 + " "JOURNAL_PARAMETER_DATA_ONLY":true or "JOURNAL_PARAMETER_DATA_ONLY":false\n"
1326 " Quickly respond with data requested, without generating a\n"
1333 - " histogram and facets counters.\n"
1327 + " `histogram`, `facets` counters and `items`.\n"
1328 + "\n"
1329 + " "JOURNAL_PARAMETER_DELTA":true or "JOURNAL_PARAMETER_DELTA":false\n"
1330 + " When doing data only queries, include deltas for histogram, facets and items.\n"
1331 + "\n"
1332 + " "JOURNAL_PARAMETER_TAIL":true or "JOURNAL_PARAMETER_TAIL":false\n"
1333 + " When doing data only queries, respond with the newest messages,\n"
1334 + " and up to the anchor, but calculate deltas (if requested) for\n"
1335 + " the duration [anchor - before].\n"
1336 "\n"
1337 " "JOURNAL_PARAMETER_SLICE":true or "JOURNAL_PARAMETER_SLICE":false\n"
1338 " When it is turned on, the plugin is executing filtering via libsystemd,\n"
@@ -1390,13 +1392,6 @@ static void netdata_systemd_journal_function_help(const char *transaction) {
1392 " Apply filters to the query, based on the facet IDs returned.\n"
1393 " Each `facet_id` can be given once, but multiple `facet_ids` can be given.\n"
1394 "\n"
1393 - " There is special mode. By specifying:\n"
1394 - "\n"
1395 - " - `"JOURNAL_PARAMETER_DIRECTION":forward`,\n"
1396 - " - `"JOURNAL_PARAMETER_ANCHOR":TIMESTAMP_IN_USEC`,\n"
1397 - " - `"JOURNAL_PARAMETER_DATA_ONLY"`, and\n"
1398 - " - `"JOURNAL_PARAMETER_IF_MODIFIED_SINCE":TIMESTAMP_IN_USEC`\n"
1399 - "\n"
1395 , program_name
1396 , SYSTEMD_JOURNAL_FUNCTION_NAME
1397 , SYSTEMD_JOURNAL_FUNCTION_DESCRIPTION
@@ -2166,7 +2161,7 @@ static void function_systemd_journal(const char *transaction, char *function, in
2161 SD_JOURNAL_FILE_SOURCE_TYPE source_type = SDJF_ALL;
2162 size_t filters = 0;
2163
2169 - buffer_json_member_add_object(wb, "request");
2164 + buffer_json_member_add_object(wb, "_request");
2165
2166 char *words[SYSTEMD_JOURNAL_MAX_PARAMS] = { NULL };
2167 size_t num_words = quoted_strings_splitter_pluginsd(function, words, SYSTEMD_JOURNAL_MAX_PARAMS);
libnetdata/facets/facets.c
+1 -1
@@ -2392,7 +2392,7 @@ void facets_report(FACETS *facets, BUFFER *wb, DICTIONARY *used_hashes_registry)
2392 // ------------------------------------------------------------------------
2393 // stats
2394
2395 - buffer_json_member_add_object(wb, "stats");
2395 + buffer_json_member_add_object(wb, "_stats");
2396 {
2397 buffer_json_member_add_uint64(wb, "first", facets->operations.first);
2398 buffer_json_member_add_uint64(wb, "forwards", facets->operations.forwards);