Skip to content

Commit

Permalink
dns request
Browse files Browse the repository at this point in the history
  • Loading branch information
meowjesty committed Dec 30, 2024
1 parent a4c9ff7 commit bb063c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mirrord/agent/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use tracing::Level;

use crate::{
error::{AgentError, AgentResult},
metrics::DNS_REQUEST_COUNT,
watched_task::TaskStatus,
};

Expand Down Expand Up @@ -187,6 +188,7 @@ impl DnsApi {
}

self.responses.push_back(response_rx);
DNS_REQUEST_COUNT.inc();

Ok(())
}
Expand All @@ -209,6 +211,8 @@ impl DnsApi {
}),
});

DNS_REQUEST_COUNT.dec();

Ok(GetAddrInfoResponse(response))
}
}
8 changes: 8 additions & 0 deletions mirrord/agent/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ pub(crate) static CLIENT_COUNT: LazyLock<IntGauge> = LazyLock::new(|| {
.expect("Valid at initialization!")
});

pub(crate) static DNS_REQUEST_COUNT: LazyLock<IntGauge> = LazyLock::new(|| {
register_int_gauge!(
"mirrord_agent_dns_request_count",
"amount of in-progress dns requests in the mirrord-agent"
)
.expect("Valid at initialization!")
});

pub(crate) static OPEN_FD_COUNT: LazyLock<IntGauge> = LazyLock::new(|| {
register_int_gauge!(
"mirrord_agent_open_fd_count",
Expand Down

0 comments on commit bb063c9

Please sign in to comment.