From bcbb39a3d3abfa259cec342ab0b47687927cf68d Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Mon, 13 Jan 2025 10:38:54 -0800 Subject: [PATCH] feat: add `route` to tracing spans, use tracing in testing --- .vscode/settings.json | 3 +- riven/Cargo.toml | 4 +- riven/src/endpoints.rs | 174 +++++++++++++++++------------------ riven/srcgen/endpoints.rs.dt | 2 +- riven/tests/testutils.rs | 8 +- 5 files changed, 99 insertions(+), 92 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4b4529f..7d6ba77 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,12 +4,13 @@ // Set output levels for `tracing` logging. "env": { "RUST_BACKTRACE": "1", - "RUST_LOG": "riven=debug" + "RUST_LOG": "info,riven=debug" } } ], "rust-analyzer.cargo.features": [ "nightly", + "tracing", "deny-unknown" ] } diff --git a/riven/Cargo.toml b/riven/Cargo.toml index 2a3ecab..6f46006 100644 --- a/riven/Cargo.toml +++ b/riven/Cargo.toml @@ -69,10 +69,10 @@ gloo-timers = { version = "0.3", features = [ "futures" ] } web-time = "1.0.0" [dev-dependencies] -env_logger = "0.10.0" +env_logger = "0.11.0" fake_instant = "0.5.0" tracing = "0.1" -tracing-subscriber = "0.2" +tracing-subscriber = "0.3.17" [target.'cfg(not(target_family = "wasm"))'.dev-dependencies] hyper = { version = "0.14", features = [ "server" ] } diff --git a/riven/src/endpoints.rs b/riven/src/endpoints.rs index 9fae960..4aafa02 100644 --- a/riven/src/endpoints.rs +++ b/riven/src/endpoints.rs @@ -327,7 +327,7 @@ impl<'a> AccountV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/riot/account/v1/accounts/by-puuid/{}", puuid)); let future = self.base.execute_val::("account-v1.getByPuuid", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getByPuuid")); + let future = future.instrument(tracing::info_span!("account-v1.getByPuuid", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "account-v1.getByPuuid", route_str); future @@ -349,7 +349,7 @@ impl<'a> AccountV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/riot/account/v1/accounts/by-riot-id/{}/{}", game_name, tag_line)); let future = self.base.execute_opt::("account-v1.getByRiotId", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getByRiotId")); + let future = future.instrument(tracing::info_span!("account-v1.getByRiotId", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "account-v1.getByRiotId", route_str); future @@ -375,7 +375,7 @@ impl<'a> AccountV1<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::("account-v1.getByAccessToken", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getByAccessToken")); + let future = future.instrument(tracing::info_span!("account-v1.getByAccessToken", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "account-v1.getByAccessToken", route_str); future @@ -397,7 +397,7 @@ impl<'a> AccountV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/riot/account/v1/active-shards/by-game/{}/by-puuid/{}", game, puuid)); let future = self.base.execute_opt::("account-v1.getActiveShard", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getActiveShard")); + let future = future.instrument(tracing::info_span!("account-v1.getActiveShard", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "account-v1.getActiveShard", route_str); future @@ -430,7 +430,7 @@ impl<'a> ChampionMasteryV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}", encrypted_puuid)); let future = self.base.execute_val::>("champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getAllChampionMasteriesByPUUID")); + let future = future.instrument(tracing::info_span!("champion-mastery-v4.getAllChampionMasteriesByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str); future @@ -452,7 +452,7 @@ impl<'a> ChampionMasteryV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/by-champion/{}", encrypted_puuid, champion_id)); let future = self.base.execute_val::("champion-mastery-v4.getChampionMasteryByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryByPUUID")); + let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "champion-mastery-v4.getChampionMasteryByPUUID", route_str); future @@ -475,7 +475,7 @@ impl<'a> ChampionMasteryV4<'a> { let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request }; let future = self.base.execute_val::>("champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getTopChampionMasteriesByPUUID")); + let future = future.instrument(tracing::info_span!("champion-mastery-v4.getTopChampionMasteriesByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str); future @@ -496,7 +496,7 @@ impl<'a> ChampionMasteryV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/scores/by-puuid/{}", encrypted_puuid)); let future = self.base.execute_val::("champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryScoreByPUUID")); + let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryScoreByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str); future @@ -528,7 +528,7 @@ impl<'a> ChampionV3<'a> { let request = self.base.request(Method::GET, route_str, "/lol/platform/v3/champion-rotations"); let future = self.base.execute_val::("champion-v3.getChampionInfo", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-v3.getChampionInfo")); + let future = future.instrument(tracing::info_span!("champion-v3.getChampionInfo", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "champion-v3.getChampionInfo", route_str); future @@ -563,7 +563,7 @@ impl<'a> ClashV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/players/by-puuid/{}", puuid)); let future = self.base.execute_val::>("clash-v1.getPlayersByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getPlayersByPUUID")); + let future = future.instrument(tracing::info_span!("clash-v1.getPlayersByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "clash-v1.getPlayersByPUUID", route_str); future @@ -586,7 +586,7 @@ impl<'a> ClashV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/players/by-summoner/{}", summoner_id)); let future = self.base.execute_val::>("clash-v1.getPlayersBySummoner", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getPlayersBySummoner")); + let future = future.instrument(tracing::info_span!("clash-v1.getPlayersBySummoner", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "clash-v1.getPlayersBySummoner", route_str); future @@ -607,7 +607,7 @@ impl<'a> ClashV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/teams/{}", team_id)); let future = self.base.execute_opt::("clash-v1.getTeamById", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTeamById")); + let future = future.instrument(tracing::info_span!("clash-v1.getTeamById", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "clash-v1.getTeamById", route_str); future @@ -627,7 +627,7 @@ impl<'a> ClashV1<'a> { let request = self.base.request(Method::GET, route_str, "/lol/clash/v1/tournaments"); let future = self.base.execute_val::>("clash-v1.getTournaments", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTournaments")); + let future = future.instrument(tracing::info_span!("clash-v1.getTournaments", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "clash-v1.getTournaments", route_str); future @@ -648,7 +648,7 @@ impl<'a> ClashV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/tournaments/by-team/{}", team_id)); let future = self.base.execute_opt::("clash-v1.getTournamentByTeam", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTournamentByTeam")); + let future = future.instrument(tracing::info_span!("clash-v1.getTournamentByTeam", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "clash-v1.getTournamentByTeam", route_str); future @@ -669,7 +669,7 @@ impl<'a> ClashV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/tournaments/{}", tournament_id)); let future = self.base.execute_opt::("clash-v1.getTournamentById", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTournamentById")); + let future = future.instrument(tracing::info_span!("clash-v1.getTournamentById", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "clash-v1.getTournamentById", route_str); future @@ -706,7 +706,7 @@ impl<'a> LeagueExpV4<'a> { let request = if let Some(page) = page { request.query(&[ ("page", page) ]) } else { request }; let future = self.base.execute_opt::>("league-exp-v4.getLeagueEntries", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-exp-v4.getLeagueEntries")); + let future = future.instrument(tracing::info_span!("league-exp-v4.getLeagueEntries", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-exp-v4.getLeagueEntries", route_str); future @@ -739,7 +739,7 @@ impl<'a> LeagueV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/challengerleagues/by-queue/{}", queue)); let future = self.base.execute_val::("league-v4.getChallengerLeague", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getChallengerLeague")); + let future = future.instrument(tracing::info_span!("league-v4.getChallengerLeague", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-v4.getChallengerLeague", route_str); future @@ -760,7 +760,7 @@ impl<'a> LeagueV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/entries/by-summoner/{}", encrypted_summoner_id)); let future = self.base.execute_val::>("league-v4.getLeagueEntriesForSummoner", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntriesForSummoner")); + let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntriesForSummoner", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-v4.getLeagueEntriesForSummoner", route_str); future @@ -785,7 +785,7 @@ impl<'a> LeagueV4<'a> { let request = if let Some(page) = page { request.query(&[ ("page", page) ]) } else { request }; let future = self.base.execute_opt::>("league-v4.getLeagueEntries", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntries")); + let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntries", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-v4.getLeagueEntries", route_str); future @@ -806,7 +806,7 @@ impl<'a> LeagueV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/grandmasterleagues/by-queue/{}", queue)); let future = self.base.execute_val::("league-v4.getGrandmasterLeague", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getGrandmasterLeague")); + let future = future.instrument(tracing::info_span!("league-v4.getGrandmasterLeague", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-v4.getGrandmasterLeague", route_str); future @@ -827,7 +827,7 @@ impl<'a> LeagueV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/leagues/{}", league_id)); let future = self.base.execute_opt::("league-v4.getLeagueById", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueById")); + let future = future.instrument(tracing::info_span!("league-v4.getLeagueById", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-v4.getLeagueById", route_str); future @@ -848,7 +848,7 @@ impl<'a> LeagueV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/masterleagues/by-queue/{}", queue)); let future = self.base.execute_val::("league-v4.getMasterLeague", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getMasterLeague")); + let future = future.instrument(tracing::info_span!("league-v4.getMasterLeague", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "league-v4.getMasterLeague", route_str); future @@ -880,7 +880,7 @@ impl<'a> LolChallengesV1<'a> { let request = self.base.request(Method::GET, route_str, "/lol/challenges/v1/challenges/config"); let future = self.base.execute_val::>("lol-challenges-v1.getAllChallengeConfigs", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengeConfigs")); + let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengeConfigs", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-challenges-v1.getAllChallengeConfigs", route_str); future @@ -900,7 +900,7 @@ impl<'a> LolChallengesV1<'a> { let request = self.base.request(Method::GET, route_str, "/lol/challenges/v1/challenges/percentiles"); let future = self.base.execute_val::>>("lol-challenges-v1.getAllChallengePercentiles", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengePercentiles")); + let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengePercentiles", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-challenges-v1.getAllChallengePercentiles", route_str); future @@ -921,7 +921,7 @@ impl<'a> LolChallengesV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/config", challenge_id)); let future = self.base.execute_opt::("lol-challenges-v1.getChallengeConfigs", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeConfigs")); + let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeConfigs", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-challenges-v1.getChallengeConfigs", route_str); future @@ -945,7 +945,7 @@ impl<'a> LolChallengesV1<'a> { let request = if let Some(limit) = limit { request.query(&[ ("limit", limit) ]) } else { request }; let future = self.base.execute_opt::>("lol-challenges-v1.getChallengeLeaderboards", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeLeaderboards")); + let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeLeaderboards", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-challenges-v1.getChallengeLeaderboards", route_str); future @@ -966,7 +966,7 @@ impl<'a> LolChallengesV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/percentiles", challenge_id)); let future = self.base.execute_opt::>("lol-challenges-v1.getChallengePercentiles", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengePercentiles")); + let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengePercentiles", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-challenges-v1.getChallengePercentiles", route_str); future @@ -987,7 +987,7 @@ impl<'a> LolChallengesV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/player-data/{}", puuid)); let future = self.base.execute_val::("lol-challenges-v1.getPlayerData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getPlayerData")); + let future = future.instrument(tracing::info_span!("lol-challenges-v1.getPlayerData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-challenges-v1.getPlayerData", route_str); future @@ -1037,7 +1037,7 @@ impl<'a> LolRsoMatchV1<'a> { let request = if let Some(r#type) = r#type { request.query(&[ ("type", r#type) ]) } else { request }; let future = self.base.execute_val::>("lol-rso-match-v1.getMatchIds", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getMatchIds")); + let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getMatchIds", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-rso-match-v1.getMatchIds", route_str); future @@ -1064,7 +1064,7 @@ impl<'a> LolRsoMatchV1<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::("lol-rso-match-v1.getMatch", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getMatch")); + let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getMatch", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-rso-match-v1.getMatch", route_str); future @@ -1091,7 +1091,7 @@ impl<'a> LolRsoMatchV1<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::("lol-rso-match-v1.getTimeline", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getTimeline")); + let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getTimeline", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-rso-match-v1.getTimeline", route_str); future @@ -1123,7 +1123,7 @@ impl<'a> LolStatusV4<'a> { let request = self.base.request(Method::GET, route_str, "/lol/status/v4/platform-data"); let future = self.base.execute_val::("lol-status-v4.getPlatformData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-status-v4.getPlatformData")); + let future = future.instrument(tracing::info_span!("lol-status-v4.getPlatformData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lol-status-v4.getPlatformData", route_str); future @@ -1161,7 +1161,7 @@ impl<'a> LorDeckV1<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::>("lor-deck-v1.getDecks", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-deck-v1.getDecks")); + let future = future.instrument(tracing::info_span!("lor-deck-v1.getDecks", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-deck-v1.getDecks", route_str); future @@ -1188,7 +1188,7 @@ impl<'a> LorDeckV1<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::("lor-deck-v1.createDeck", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-deck-v1.createDeck")); + let future = future.instrument(tracing::info_span!("lor-deck-v1.createDeck", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-deck-v1.createDeck", route_str); future @@ -1226,7 +1226,7 @@ impl<'a> LorInventoryV1<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::>("lor-inventory-v1.getCards", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-inventory-v1.getCards")); + let future = future.instrument(tracing::info_span!("lor-inventory-v1.getCards", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-inventory-v1.getCards", route_str); future @@ -1259,7 +1259,7 @@ impl<'a> LorMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lor/match/v1/matches/by-puuid/{}/ids", puuid)); let future = self.base.execute_val::>("lor-match-v1.getMatchIdsByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-match-v1.getMatchIdsByPUUID")); + let future = future.instrument(tracing::info_span!("lor-match-v1.getMatchIdsByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-match-v1.getMatchIdsByPUUID", route_str); future @@ -1280,7 +1280,7 @@ impl<'a> LorMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lor/match/v1/matches/{}", match_id)); let future = self.base.execute_val::("lor-match-v1.getMatch", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-match-v1.getMatch")); + let future = future.instrument(tracing::info_span!("lor-match-v1.getMatch", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-match-v1.getMatch", route_str); future @@ -1312,7 +1312,7 @@ impl<'a> LorRankedV1<'a> { let request = self.base.request(Method::GET, route_str, "/lor/ranked/v1/leaderboards"); let future = self.base.execute_val::("lor-ranked-v1.getLeaderboards", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-ranked-v1.getLeaderboards")); + let future = future.instrument(tracing::info_span!("lor-ranked-v1.getLeaderboards", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-ranked-v1.getLeaderboards", route_str); future @@ -1344,7 +1344,7 @@ impl<'a> LorStatusV1<'a> { let request = self.base.request(Method::GET, route_str, "/lor/status/v1/platform-data"); let future = self.base.execute_val::("lor-status-v1.getPlatformData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-status-v1.getPlatformData")); + let future = future.instrument(tracing::info_span!("lor-status-v1.getPlatformData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "lor-status-v1.getPlatformData", route_str); future @@ -1389,7 +1389,7 @@ impl<'a> MatchV5<'a> { let request = if let Some(r#type) = r#type { request.query(&[ ("type", r#type) ]) } else { request }; let future = self.base.execute_val::>("match-v5.getMatchIdsByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("match-v5.getMatchIdsByPUUID")); + let future = future.instrument(tracing::info_span!("match-v5.getMatchIdsByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "match-v5.getMatchIdsByPUUID", route_str); future @@ -1410,7 +1410,7 @@ impl<'a> MatchV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/match/v5/matches/{}", match_id)); let future = self.base.execute_opt::("match-v5.getMatch", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("match-v5.getMatch")); + let future = future.instrument(tracing::info_span!("match-v5.getMatch", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "match-v5.getMatch", route_str); future @@ -1431,7 +1431,7 @@ impl<'a> MatchV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/match/v5/matches/{}/timeline", match_id)); let future = self.base.execute_opt::("match-v5.getTimeline", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("match-v5.getTimeline")); + let future = future.instrument(tracing::info_span!("match-v5.getTimeline", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "match-v5.getTimeline", route_str); future @@ -1464,7 +1464,7 @@ impl<'a> SpectatorTftV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/spectator/tft/v5/active-games/by-puuid/{}", encrypted_puuid)); let future = self.base.execute_opt::("spectator-tft-v5.getCurrentGameInfoByPuuid", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-tft-v5.getCurrentGameInfoByPuuid")); + let future = future.instrument(tracing::info_span!("spectator-tft-v5.getCurrentGameInfoByPuuid", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "spectator-tft-v5.getCurrentGameInfoByPuuid", route_str); future @@ -1484,7 +1484,7 @@ impl<'a> SpectatorTftV5<'a> { let request = self.base.request(Method::GET, route_str, "/lol/spectator/tft/v5/featured-games"); let future = self.base.execute_val::("spectator-tft-v5.getFeaturedGames", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-tft-v5.getFeaturedGames")); + let future = future.instrument(tracing::info_span!("spectator-tft-v5.getFeaturedGames", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "spectator-tft-v5.getFeaturedGames", route_str); future @@ -1517,7 +1517,7 @@ impl<'a> SpectatorV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/spectator/v5/active-games/by-summoner/{}", encrypted_puuid)); let future = self.base.execute_opt::("spectator-v5.getCurrentGameInfoByPuuid", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-v5.getCurrentGameInfoByPuuid")); + let future = future.instrument(tracing::info_span!("spectator-v5.getCurrentGameInfoByPuuid", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "spectator-v5.getCurrentGameInfoByPuuid", route_str); future @@ -1537,7 +1537,7 @@ impl<'a> SpectatorV5<'a> { let request = self.base.request(Method::GET, route_str, "/lol/spectator/v5/featured-games"); let future = self.base.execute_val::("spectator-v5.getFeaturedGames", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-v5.getFeaturedGames")); + let future = future.instrument(tracing::info_span!("spectator-v5.getFeaturedGames", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "spectator-v5.getFeaturedGames", route_str); future @@ -1570,7 +1570,7 @@ impl<'a> SummonerV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/fulfillment/v1/summoners/by-puuid/{}", rso_puuid)); let future = self.base.execute_val::("summoner-v4.getByRSOPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByRSOPUUID")); + let future = future.instrument(tracing::info_span!("summoner-v4.getByRSOPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "summoner-v4.getByRSOPUUID", route_str); future @@ -1591,7 +1591,7 @@ impl<'a> SummonerV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/summoner/v4/summoners/by-account/{}", encrypted_account_id)); let future = self.base.execute_val::("summoner-v4.getByAccountId", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByAccountId")); + let future = future.instrument(tracing::info_span!("summoner-v4.getByAccountId", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "summoner-v4.getByAccountId", route_str); future @@ -1612,7 +1612,7 @@ impl<'a> SummonerV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/summoner/v4/summoners/by-puuid/{}", encrypted_puuid)); let future = self.base.execute_val::("summoner-v4.getByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByPUUID")); + let future = future.instrument(tracing::info_span!("summoner-v4.getByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "summoner-v4.getByPUUID", route_str); future @@ -1638,7 +1638,7 @@ impl<'a> SummonerV4<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::("summoner-v4.getByAccessToken", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByAccessToken")); + let future = future.instrument(tracing::info_span!("summoner-v4.getByAccessToken", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "summoner-v4.getByAccessToken", route_str); future @@ -1659,7 +1659,7 @@ impl<'a> SummonerV4<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/summoner/v4/summoners/{}", encrypted_summoner_id)); let future = self.base.execute_val::("summoner-v4.getBySummonerId", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getBySummonerId")); + let future = future.instrument(tracing::info_span!("summoner-v4.getBySummonerId", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "summoner-v4.getBySummonerId", route_str); future @@ -1693,7 +1693,7 @@ impl<'a> TftLeagueV1<'a> { let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; let future = self.base.execute_val::("tft-league-v1.getChallengerLeague", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getChallengerLeague")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getChallengerLeague", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getChallengerLeague", route_str); future @@ -1714,7 +1714,7 @@ impl<'a> TftLeagueV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/entries/by-summoner/{}", summoner_id)); let future = self.base.execute_val::>("tft-league-v1.getLeagueEntriesForSummoner", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueEntriesForSummoner")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueEntriesForSummoner", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getLeagueEntriesForSummoner", route_str); future @@ -1740,7 +1740,7 @@ impl<'a> TftLeagueV1<'a> { let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; let future = self.base.execute_val::>("tft-league-v1.getLeagueEntries", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueEntries")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueEntries", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getLeagueEntries", route_str); future @@ -1762,7 +1762,7 @@ impl<'a> TftLeagueV1<'a> { let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; let future = self.base.execute_val::("tft-league-v1.getGrandmasterLeague", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getGrandmasterLeague")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getGrandmasterLeague", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getGrandmasterLeague", route_str); future @@ -1783,7 +1783,7 @@ impl<'a> TftLeagueV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/leagues/{}", league_id)); let future = self.base.execute_opt::("tft-league-v1.getLeagueById", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueById")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueById", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getLeagueById", route_str); future @@ -1805,7 +1805,7 @@ impl<'a> TftLeagueV1<'a> { let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; let future = self.base.execute_val::("tft-league-v1.getMasterLeague", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getMasterLeague")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getMasterLeague", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getMasterLeague", route_str); future @@ -1826,7 +1826,7 @@ impl<'a> TftLeagueV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/rated-ladders/{}/top", queue)); let future = self.base.execute_val::>("tft-league-v1.getTopRatedLadder", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getTopRatedLadder")); + let future = future.instrument(tracing::info_span!("tft-league-v1.getTopRatedLadder", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-league-v1.getTopRatedLadder", route_str); future @@ -1867,7 +1867,7 @@ impl<'a> TftMatchV1<'a> { let request = if let Some(start_time) = start_time { request.query(&[ ("startTime", start_time) ]) } else { request }; let future = self.base.execute_val::>("tft-match-v1.getMatchIdsByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-match-v1.getMatchIdsByPUUID")); + let future = future.instrument(tracing::info_span!("tft-match-v1.getMatchIdsByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-match-v1.getMatchIdsByPUUID", route_str); future @@ -1888,7 +1888,7 @@ impl<'a> TftMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/match/v1/matches/{}", match_id)); let future = self.base.execute_opt::("tft-match-v1.getMatch", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-match-v1.getMatch")); + let future = future.instrument(tracing::info_span!("tft-match-v1.getMatch", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-match-v1.getMatch", route_str); future @@ -1920,7 +1920,7 @@ impl<'a> TftStatusV1<'a> { let request = self.base.request(Method::GET, route_str, "/tft/status/v1/platform-data"); let future = self.base.execute_val::("tft-status-v1.getPlatformData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-status-v1.getPlatformData")); + let future = future.instrument(tracing::info_span!("tft-status-v1.getPlatformData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-status-v1.getPlatformData", route_str); future @@ -1953,7 +1953,7 @@ impl<'a> TftSummonerV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/summoner/v1/summoners/by-account/{}", encrypted_account_id)); let future = self.base.execute_val::("tft-summoner-v1.getByAccountId", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByAccountId")); + let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByAccountId", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-summoner-v1.getByAccountId", route_str); future @@ -1974,7 +1974,7 @@ impl<'a> TftSummonerV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/summoner/v1/summoners/by-puuid/{}", encrypted_puuid)); let future = self.base.execute_val::("tft-summoner-v1.getByPUUID", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByPUUID")); + let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByPUUID", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-summoner-v1.getByPUUID", route_str); future @@ -2000,7 +2000,7 @@ impl<'a> TftSummonerV1<'a> { if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } let future = self.base.execute_val::("tft-summoner-v1.getByAccessToken", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByAccessToken")); + let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByAccessToken", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-summoner-v1.getByAccessToken", route_str); future @@ -2021,7 +2021,7 @@ impl<'a> TftSummonerV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/tft/summoner/v1/summoners/{}", encrypted_summoner_id)); let future = self.base.execute_val::("tft-summoner-v1.getBySummonerId", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getBySummonerId")); + let future = future.instrument(tracing::info_span!("tft-summoner-v1.getBySummonerId", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tft-summoner-v1.getBySummonerId", route_str); future @@ -2058,7 +2058,7 @@ impl<'a> TournamentStubV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::>("tournament-stub-v5.createTournamentCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.createTournamentCode")); + let future = future.instrument(tracing::info_span!("tournament-stub-v5.createTournamentCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-stub-v5.createTournamentCode", route_str); future @@ -2079,7 +2079,7 @@ impl<'a> TournamentStubV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament-stub/v5/codes/{}", tournament_code)); let future = self.base.execute_val::("tournament-stub-v5.getTournamentCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.getTournamentCode")); + let future = future.instrument(tracing::info_span!("tournament-stub-v5.getTournamentCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-stub-v5.getTournamentCode", route_str); future @@ -2100,7 +2100,7 @@ impl<'a> TournamentStubV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament-stub/v5/lobby-events/by-code/{}", tournament_code)); let future = self.base.execute_val::("tournament-stub-v5.getLobbyEventsByCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.getLobbyEventsByCode")); + let future = future.instrument(tracing::info_span!("tournament-stub-v5.getLobbyEventsByCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-stub-v5.getLobbyEventsByCode", route_str); future @@ -2123,7 +2123,7 @@ impl<'a> TournamentStubV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::("tournament-stub-v5.registerProviderData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerProviderData")); + let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerProviderData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-stub-v5.registerProviderData", route_str); future @@ -2144,7 +2144,7 @@ impl<'a> TournamentStubV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::("tournament-stub-v5.registerTournament", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerTournament")); + let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerTournament", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-stub-v5.registerTournament", route_str); future @@ -2181,7 +2181,7 @@ impl<'a> TournamentV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::>("tournament-v5.createTournamentCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.createTournamentCode")); + let future = future.instrument(tracing::info_span!("tournament-v5.createTournamentCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.createTournamentCode", route_str); future @@ -2202,7 +2202,7 @@ impl<'a> TournamentV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/codes/{}", tournament_code)); let future = self.base.execute_val::("tournament-v5.getTournamentCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.getTournamentCode")); + let future = future.instrument(tracing::info_span!("tournament-v5.getTournamentCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.getTournamentCode", route_str); future @@ -2224,7 +2224,7 @@ impl<'a> TournamentV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute("tournament-v5.updateCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.updateCode")); + let future = future.instrument(tracing::info_span!("tournament-v5.updateCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.updateCode", route_str); future @@ -2251,7 +2251,7 @@ impl<'a> TournamentV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/games/by-code/{}", tournament_code)); let future = self.base.execute_val::>("tournament-v5.getGames", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.getGames")); + let future = future.instrument(tracing::info_span!("tournament-v5.getGames", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.getGames", route_str); future @@ -2272,7 +2272,7 @@ impl<'a> TournamentV5<'a> { let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/lobby-events/by-code/{}", tournament_code)); let future = self.base.execute_val::("tournament-v5.getLobbyEventsByCode", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.getLobbyEventsByCode")); + let future = future.instrument(tracing::info_span!("tournament-v5.getLobbyEventsByCode", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.getLobbyEventsByCode", route_str); future @@ -2295,7 +2295,7 @@ impl<'a> TournamentV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::("tournament-v5.registerProviderData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.registerProviderData")); + let future = future.instrument(tracing::info_span!("tournament-v5.registerProviderData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.registerProviderData", route_str); future @@ -2316,7 +2316,7 @@ impl<'a> TournamentV5<'a> { let request = request.body(serde_json::ser::to_vec(body).unwrap()); let future = self.base.execute_val::("tournament-v5.registerTournament", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.registerTournament")); + let future = future.instrument(tracing::info_span!("tournament-v5.registerTournament", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "tournament-v5.registerTournament", route_str); future @@ -2349,7 +2349,7 @@ impl<'a> ValConsoleMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/val/match/console/v1/matches/{}", match_id)); let future = self.base.execute_val::("val-console-match-v1.getMatch", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-match-v1.getMatch")); + let future = future.instrument(tracing::info_span!("val-console-match-v1.getMatch", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-console-match-v1.getMatch", route_str); future @@ -2372,7 +2372,7 @@ impl<'a> ValConsoleMatchV1<'a> { let request = request.query(&[ ("platformType", platform_type) ]); let future = self.base.execute_val::("val-console-match-v1.getMatchlist", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-match-v1.getMatchlist")); + let future = future.instrument(tracing::info_span!("val-console-match-v1.getMatchlist", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-console-match-v1.getMatchlist", route_str); future @@ -2395,7 +2395,7 @@ impl<'a> ValConsoleMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/val/match/console/v1/recent-matches/by-queue/{}", queue)); let future = self.base.execute_val::("val-console-match-v1.getRecent", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-match-v1.getRecent")); + let future = future.instrument(tracing::info_span!("val-console-match-v1.getRecent", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-console-match-v1.getRecent", route_str); future @@ -2434,7 +2434,7 @@ impl<'a> ValConsoleRankedV1<'a> { let request = if let Some(start_index) = start_index { request.query(&[ ("startIndex", start_index) ]) } else { request }; let future = self.base.execute_val::("val-console-ranked-v1.getLeaderboard", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-ranked-v1.getLeaderboard")); + let future = future.instrument(tracing::info_span!("val-console-ranked-v1.getLeaderboard", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-console-ranked-v1.getLeaderboard", route_str); future @@ -2468,7 +2468,7 @@ impl<'a> ValContentV1<'a> { let request = if let Some(locale) = locale { request.query(&[ ("locale", locale) ]) } else { request }; let future = self.base.execute_val::("val-content-v1.getContent", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-content-v1.getContent")); + let future = future.instrument(tracing::info_span!("val-content-v1.getContent", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-content-v1.getContent", route_str); future @@ -2501,7 +2501,7 @@ impl<'a> ValMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/val/match/v1/matches/{}", match_id)); let future = self.base.execute_opt::("val-match-v1.getMatch", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-match-v1.getMatch")); + let future = future.instrument(tracing::info_span!("val-match-v1.getMatch", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-match-v1.getMatch", route_str); future @@ -2522,7 +2522,7 @@ impl<'a> ValMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/val/match/v1/matchlists/by-puuid/{}", puuid)); let future = self.base.execute_val::("val-match-v1.getMatchlist", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-match-v1.getMatchlist")); + let future = future.instrument(tracing::info_span!("val-match-v1.getMatchlist", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-match-v1.getMatchlist", route_str); future @@ -2545,7 +2545,7 @@ impl<'a> ValMatchV1<'a> { let request = self.base.request(Method::GET, route_str, &format!("/val/match/v1/recent-matches/by-queue/{}", queue)); let future = self.base.execute_val::("val-match-v1.getRecent", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-match-v1.getRecent")); + let future = future.instrument(tracing::info_span!("val-match-v1.getRecent", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-match-v1.getRecent", route_str); future @@ -2582,7 +2582,7 @@ impl<'a> ValRankedV1<'a> { let request = if let Some(start_index) = start_index { request.query(&[ ("startIndex", start_index) ]) } else { request }; let future = self.base.execute_opt::("val-ranked-v1.getLeaderboard", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-ranked-v1.getLeaderboard")); + let future = future.instrument(tracing::info_span!("val-ranked-v1.getLeaderboard", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-ranked-v1.getLeaderboard", route_str); future @@ -2614,7 +2614,7 @@ impl<'a> ValStatusV1<'a> { let request = self.base.request(Method::GET, route_str, "/val/status/v1/platform-data"); let future = self.base.execute_val::("val-status-v1.getPlatformData", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-status-v1.getPlatformData")); + let future = future.instrument(tracing::info_span!("val-status-v1.getPlatformData", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "val-status-v1.getPlatformData", route_str); future diff --git a/riven/srcgen/endpoints.rs.dt b/riven/srcgen/endpoints.rs.dt index ff485a1..7da0cf1 100644 --- a/riven/srcgen/endpoints.rs.dt +++ b/riven/srcgen/endpoints.rs.dt @@ -203,7 +203,7 @@ impl<'a> {{= endpoint }}<'a> { {{?}} let future = self.base.execute{{= hasReturn ? (returnOptional ? '_opt' : '_val') : '' }}{{= returnTypeTurbofish }}("{{= operationId }}", route_str, request); #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("{{= operationId }}")); + let future = future.instrument(tracing::info_span!("{{= operationId }}", route = route_str)); #[cfg(feature = "metrics")] let future = metrics::timed(future, "{{= operationId }}", route_str); future diff --git a/riven/tests/testutils.rs b/riven/tests/testutils.rs index 650705f..3ebf68c 100644 --- a/riven/tests/testutils.rs +++ b/riven/tests/testutils.rs @@ -78,7 +78,13 @@ pub fn riot_api() -> &'static RiotApi { RIOT_API.get_or_init(|| { // Initialize logger here, as a convenient trigger spot. #[cfg(not(target_family = "wasm"))] - env_logger::init(); + { + #[cfg(not(feature = "tracing"))] + env_logger::init(); + #[cfg(feature = "tracing")] + tracing_subscriber::fmt::init(); + } + #[cfg(target_family = "wasm")] console_log::init_with_level(log::Level::Info).unwrap();