-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodejs_version_info empty after registry reset #238
Comments
Yeah I would say that fixing it as suggested in #180 would be the way to fix this problem as well! |
Not quite - after resetting the registry, the I had to make a few other changes for v12.0 (ssube/isolex#837), but have gotten it working with a hard-coded (for the moment) timeout of 10 (https://github.com/ssube/isolex/pull/837/files#diff-5a28ddf4a6b3741f1800b6fcc801c9b1R42):
Metrics:
Not sure if this is something I'm doing wrong or related to how the version info is being collected. |
Probably the version gauge needs to return a collect function. It didn't before, and doesn't now, because the values never change. I guess the interaction with reset wasn't considered. |
* Adds a `collect` fn, which may be async, to each metric type. This provides a cleaner interface than registering collectors, and allows the collector to do asynchronous work. (Previously it would be one scrape behind if it had to do async work.) * In turn, makes `registry.metrics()` and `registry.get...` async, and removes the `collectors`/`registerCollector` functions. * Fixes `process_max_fds` and `process_start_time_seconds` so that they have values after the registry is reset (same vein as siimon#238) * Cleans up the readme a bit (removes some out-of-date info)
* Adds a `collect` fn, which may be async, to each metric type. This provides a cleaner interface than registering collectors, and allows the collector to do asynchronous work. (Previously it would be one scrape behind if it had to do async work.) * In turn, makes `registry.metrics()` and `registry.get...` async, and removes the `collectors`/`registerCollector` functions. * Fixes `process_max_fds` and `process_start_time_seconds` so that they have values after the registry is reset (same vein as siimon#238) * Cleans up the readme a bit (removes some out-of-date info)
* Adds a `collect` fn, which may be async, to each metric type. This provides a cleaner interface than registering collectors, and allows the collector to do asynchronous work. (Previously it would be one scrape behind if it had to do async work.) * In turn, makes `registry.metrics()` and `registry.get...` async, and removes the `collectors`/`registerCollector` functions. * Fixes `process_max_fds` and `process_start_time_seconds` so that they have values after the registry is reset (same vein as siimon#238) * Cleans up the readme a bit (removes some out-of-date info)
* Adds a `collect` fn, which may be async, to each metric type. This provides a cleaner interface than registering collectors, and allows the collector to do asynchronous work. (Previously it would be one scrape behind if it had to do async work.) * In turn, makes `registry.metrics()` and `registry.get...` async, and removes the `collectors`/`registerCollector` functions. * Fixes `process_max_fds` and `process_start_time_seconds` so that they have values after the registry is reset (same vein as siimon#238) * Cleans up the readme a bit (removes some out-of-date info)
* Adds a `collect` fn, which may be async, to each metric type. This provides a cleaner interface than registering collectors, and allows the collector to do asynchronous work. (Previously it would be one scrape behind if it had to do async work.) * In turn, makes `registry.metrics()` and `registry.get...` async, and removes the `collectors`/`registerCollector` functions. * Fixes `process_max_fds` and `process_start_time_seconds` so that they have values after the registry is reset (same vein as siimon#238) * Cleans up the readme a bit (removes some out-of-date info)
* Adds a `collect` fn, which may be async, to each metric type. This provides a cleaner interface than registering collectors, and allows the collector to do asynchronous work. (Previously it would be one scrape behind if it had to do async work.) * In turn, makes `registry.metrics()` and `registry.get...` async, and removes the `collectors`/`registerCollector` functions. * Fixes `process_max_fds` and `process_start_time_seconds` so that they have values after the registry is reset (same vein as #238) * Cleans up the readme a bit (removes some out-of-date info)
I've been using this library in a small bot with great results, and recently implemented a feature where SIGINT and SIGHUP will reload the config file and reset any stateful counters (for development). I'm using
collectDefaultMetrics({ registry })
to collect general Node metrics and callregistry.resetMetrics
upon receiving the signals.After calling
resetMetrics
and waiting for the next interval tick, most metrics re-appear, but not all of them:It would make sense that
nodejs_version_info
is only collected once, as it is very unlikely to change, but it seems to get lost after the registry is reset.What's the best way to make sure that metric is always populated? It would be pretty easy for me to clear the interval and call
collectDefaultMetrics
again, if that makes sense.Edit: reading further, it looks like this may be a non-issue if #180 is implemented as discussed, since my code would call that each time rather than set and reset an interval. Would that be the most correct solution?
The text was updated successfully, but these errors were encountered: