-
Notifications
You must be signed in to change notification settings - Fork 2
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
Do not print error on jobstats issue #73
Conversation
Log message at debug level when there is a jobstats collection issue, do not raise to console. Signed-off-by: Joe Grund <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #73 +/- ##
==========================================
- Coverage 92.12% 91.77% -0.36%
==========================================
Files 41 41
Lines 5182 5201 +19
Branches 5182 5201 +19
==========================================
- Hits 4774 4773 -1
- Misses 372 391 +19
- Partials 36 37 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Benchmark for 5e1db10Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not working on my side.
Tried with
diff --git a/lustrefs-exporter/src/main.rs b/lustrefs-exporter/src/main.rs
index 8ef81e6..6749c35 100644
--- a/lustrefs-exporter/src/main.rs
+++ b/lustrefs-exporter/src/main.rs
@@ -18,7 +18,7 @@ use serde::Deserialize;
use std::{
borrow::Cow,
convert::Infallible,
- io::{self, BufReader},
+ io::{self, BufRead, BufReader},
net::SocketAddr,
};
use tokio::process::Command;
@@ -96,6 +96,7 @@ async fn scrape(Query(params): Query<Params>) -> Result<Response<Body>, Error> {
.arg("get_param")
.args(["obdfilter.*OST*.job_stats", "mdt.*.job_stats"])
.stdout(std::process::Stdio::piped())
+ .stderr(std::process::Stdio::piped())
.spawn()?;
Ok::<_, Error>(child)
@@ -112,6 +113,20 @@ async fn scrape(Query(params): Query<Params>) -> Result<Response<Body>, Error> {
))?,
);
+ let reader_stderr = BufReader::with_capacity(
+ 128 * 1_024,
+ child.stderr.take().ok_or(io::Error::new(
+ io::ErrorKind::NotFound,
+ "stderr missing for lctl jobstats call.",
+ ))?,
+ );
+
+ tokio::task::spawn(async move {
+ for line in reader_stderr.lines().map_while(Result::ok) {
+ tracing::debug!("stderr: {}", line);
+ }
+ });
+
let (_, rx) = lustrefs_exporter::jobstats::jobstats_stream(reader);
let stream = ReceiverStream::new(rx)
But I am not getting any output. I guess because we are never awaiting it?
What output are you expecting that you are not getting? |
Benchmark for 485e366Click to view benchmark
|
With latest commit
|
Log message at debug level when there is a jobstats collection issue, do not raise to console.