question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass arbitrary command line flags to node_exporter

See original GitHub issue

What is missing? A way to pass arbitrary command line flags to node_exporter

Why do we need it? node_exporter has more parameters than those exposed by the variables in this role. An “escape hatch” to pass any flags would be very useful. Something like:

node_exporter_flags: ["--web.telemetry-path=/foo", "--web.max-requests=99"]

In fact, with this variable in place, node_exporter_web_listen_address could be deprecated IMO as it would be adequately covered by the more general node_exporter_flags.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
paulfantomcommented, May 22, 2020

I’ll note that node_exporter refuses to start with incorrect/unknown flags, so there is no risk of a mistake going unnoticed.

True, but the current mechanism is more about upgrades than the installation itself. A simple scenario which role wouldn’t be able to prevent with free-form flags option is this:

  1. node_exporter is already installed
  2. user sets incorrect flags and runs ansible role
  3. systemd service is updated and restarted
  4. node_exporter is in crash-loop

Above causes downtime. In contrast, failing fast in preflight.yml doesn’t update anything on host and prevents incorrect node configuration.

1reaction
paolcommented, May 22, 2020

Ah, that’s problem that I hadn’t considered, and also applies to my original idea.

In that case having separate variables for each flag is the only way to go. Consider this enhancement request officially changed 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I pass command line arguments to a Node.js program?
Here are the node docs on handling command line args: process. argv is an array containing the command line arguments. The first element...
Read more >
Handling Command Line Argument in Node.js - KnowledgeHut
An argument vector in Node.js allows the passing of a list of arguments. It is an array accessible via process.argv. All of the...
Read more >
prometheus/node_exporter: Exporter for machine metrics
To use it, set the --collector.textfile.directory flag on the node_exporter commandline. The collector will parse all files in that directory matching the glob ......
Read more >
How to read command line arguments in Node.js
Command -line arguments (CLI) are strings of text used to pass additional information to a program when an application is running through the ......
Read more >
How To Handle Command-line Arguments in Node.js Scripts
The argument vector is an array available from process.argv in your Node.js script. The array contains everything that's passed to the script, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found