Skip to content

Commit ab0e32c

Browse files
authored
Update log_collector.py
1 parent 4c14753 commit ab0e32c

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

log_collector/log_collector.py

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
logger.setLevel(logging.INFO)
3838
LOGGER_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
3939
logging.basicConfig(format=LOGGER_FORMAT)
40-
VERSION_LOG_COLLECTOR = "7.4.6-6"
40+
VERSION_LOG_COLLECTOR = "7.4.6-2"
4141

4242
TIME_FORMAT = time.strftime("%Y%m%d-%H%M%S")
4343

@@ -1420,44 +1420,40 @@ def check_not_negative(value):
14201420
if __name__ == "__main__":
14211421

14221422
# pylint: disable=locally-disabled, invalid-name
1423-
parser = argparse.ArgumentParser(description='Redis Enterprise Log Collector for Kubernetes\n\n'
1424-
'For additional details and usage instructions, see '
1425-
'https://redis.io/docs/latest/operate/kubernetes/logs/collect-logs/',
1426-
formatter_class=argparse.RawTextHelpFormatter)
1423+
parser = argparse.ArgumentParser(description='Redis Enterprise'
1424+
' K8s log collector')
14271425

14281426
parser.add_argument('-n', '--namespace', action="store", type=str,
1429-
help="Sets the namespace(s) to collect from.\n"
1430-
"Can be set to a single namespace, multiple namespaces (comma-separated), or 'all'.\n"
1431-
"When left empty, will use the current context's namespace from kubeconfig.")
1432-
parser.add_argument('-o', '--output_dir', action="store", type=str,
1433-
help="Sets the output directory.\n"
1434-
"Defaults to current working directory.")
1427+
help="pass namespace name or comma separated list or 'all' "
1428+
"when left empty will use namespace from kube config")
1429+
parser.add_argument('-o', '--output_dir', action="store", type=str)
14351430
parser.add_argument('-a', '--logs_from_all_pods', action="store_true",
1436-
help="Collect logs from all pods in the selected namespace(s),\n"
1437-
"and otherwise collect only from the operator and pods run by the operator.")
1431+
help="collect logs from all pods, not only the operator and pods run by the operator")
14381432
parser.add_argument('-t', '--timeout', action="store",
14391433
type=check_not_negative, default=TIMEOUT,
1440-
help="Time to wait for external commands to finish execution (Linux only).\n"
1441-
"Default to 180s. Specify 0 to disable timeout.")
1434+
help="time to wait for external commands to "
1435+
"finish execution "
1436+
"(default: 180s, specify 0 to not timeout) "
1437+
"(Linux only)")
14421438
parser.add_argument('--k8s_cli', action="store", type=str,
1443-
help="The K8s cli client to use (kubectl/oc/auto-detect).\n"
1444-
"Defaults to auto-detect (chooses between 'kubectl' and 'oc').\n"
1439+
help="Which K8s cli client to use (kubectl/oc/auto-detect). "
1440+
"Defaults to auto-detect (chooses between \"kubectl\" and \"oc\"). "
14451441
"Full paths can also be used.")
14461442
parser.add_argument('-m', '--mode', action="store", type=str,
14471443
choices=[MODE_RESTRICTED, MODE_ALL],
1448-
help="Controls which resources are collected:\n"
1449-
"In 'restricted' mode, only resources associated with the operator "
1450-
"and have the label 'app=redis-enterprise' are collected.\n"
1451-
"In 'all' mode, all resources are collected.\n"
1452-
"Defaults to 'restricted' mode.")
1444+
help="Which mode to run the log collector. The options are:"
1445+
"1. restricted (default for clusters of version 6.2.18 and newer) - "
1446+
"collect only resources that are related to the operator,"
1447+
" and has the label \"app=redis-enterprise\". "
1448+
"2. all - collect all resources")
14531449
parser.add_argument('--collect_istio', action="store_true",
1454-
help="Collect data from istio-system namespace to debug potential\n"
1455-
"problems related to istio ingress method.")
1450+
help="collect data from istio-system namespace to debug potential "
1451+
"problems related to istio ingress method")
14561452
parser.add_argument('--skip_support_package', action="store_true",
1457-
help="Disable collection of RS support package from Redis Enterprise nodes.")
1453+
help="not collect RS support package")
14581454
parser.add_argument('--collect_empty_files', action="store_true",
1459-
help='Collect empty log files for missing resources.')
1455+
help='collect empty log files for missing resources')
14601456
parser.add_argument('--helm_release_name', action="store", type=str,
1461-
help='Collect resources related to the given Helm release name.')
1457+
help='collect resources related to helm release name')
14621458
parser.set_defaults(collect_istio=False)
14631459
run(parser.parse_args())

0 commit comments

Comments
 (0)