hunter/worker: add hunter_requests gauges for stream_open_token

This commit is contained in:
Astro 2023-08-09 02:05:25 +02:00
parent 50d9795e6e
commit 0a3508087e
1 changed files with 2 additions and 0 deletions

View File

@ -306,7 +306,9 @@ async fn open_stream(
.expect("db.get_token()");
if let Some(token) = &token {
let url = format!("https://{}/api/v1/streaming/public?access_token={}", host, urlencoding::encode(token));
metrics::increment_gauge!("hunter_requests", 1.0, "type" => "stream_open_token");
stream = Feed::stream(client, &url).await;
metrics::decrement_gauge!("hunter_requests", 1.0, "type" => "stream_open_token");
} else {
tracing::info!("No working token for {}", host);
break;