aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache
diff options
context:
space:
mode:
authorMatthew Gumport <[email protected]>2024-10-21 10:20:49 -0700
committerKevin Guthrie <[email protected]>2024-10-28 11:51:38 -0400
commit54a641f6de869c2251c4597a59c022092deb6b4a (patch)
tree21065a98620de0fbdb3fac7d730fec072804d265 /pingora-cache
parent7be56d4f3fd90fd44081accf47bd9cc995ae28ef (diff)
downloadpingora-54a641f6de869c2251c4597a59c022092deb6b4a.tar.gz
pingora-54a641f6de869c2251c4597a59c022092deb6b4a.zip
tag subrequests as such
This adds a hook during the flow where we move the write permit around for subrequests to refresh stale assets to tag the parent span as being part of a subrequest.
Diffstat (limited to 'pingora-cache')
-rw-r--r--pingora-cache/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/pingora-cache/src/lib.rs b/pingora-cache/src/lib.rs
index 1a97041..2aa2f7c 100644
--- a/pingora-cache/src/lib.rs
+++ b/pingora-cache/src/lib.rs
@@ -1142,6 +1142,14 @@ impl HttpCache {
predictor.mark_uncacheable(self.cache_key(), reason);
}
}
+
+ /// Tag all spans as being part of a subrequest.
+ pub fn tag_as_subrequest(&mut self) {
+ self.inner_mut()
+ .traces
+ .cache_span
+ .set_tag(|| Tag::new("is_subrequest", true))
+ }
}
/// Set the header compression dictionary, which helps serialize http header.