Skip to content
Snippets Groups Projects
Commit 39c96795 authored by ale's avatar ale
Browse files

Add a --no-metrics flag to prevent writing a node-exporter snippet

parent a5cbe22e
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ int log_to_syslog = 1; ...@@ -48,6 +48,7 @@ int log_to_syslog = 1;
int locking = 1; int locking = 1;
int lock_timeout = 0; int lock_timeout = 0;
int lock_wait = 0; int lock_wait = 0;
int do_export_metrics = 1;
char *lock_dir = "/var/lock"; char *lock_dir = "/var/lock";
char *log_tag; char *log_tag;
...@@ -683,6 +684,7 @@ int main(int argc, char **argv) { ...@@ -683,6 +684,7 @@ int main(int argc, char **argv) {
{"lock-dir", required_argument, 0, 0}, {"lock-dir", required_argument, 0, 0},
{"wait", no_argument, &lock_wait, 1}, {"wait", no_argument, &lock_wait, 1},
{"node-exporter-dir", required_argument, 0, 0}, {"node-exporter-dir", required_argument, 0, 0},
{"no-metrics", no_argument, &do_export_metrics, 0},
// Legacy // Legacy
{"quiet", no_argument, 0, 'q'}, {"quiet", no_argument, 0, 'q'},
{0, 0, 0, 0}}; {0, 0, 0, 0}};
...@@ -782,7 +784,7 @@ int main(int argc, char **argv) { ...@@ -782,7 +784,7 @@ int main(int argc, char **argv) {
} }
r = run(argv + optind); r = run(argv + optind);
if (prometheus_node_exporter_enabled()) { if (do_export_metrics && prometheus_node_exporter_enabled()) {
export_metrics(r); export_metrics(r);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment