aboutsummaryrefslogtreecommitdiffhomepage
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
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.
-rw-r--r--.bleep2
-rw-r--r--pingora-cache/src/lib.rs8
-rw-r--r--pingora-proxy/src/proxy_cache.rs1
3 files changed, 10 insertions, 1 deletions
diff --git a/.bleep b/.bleep
index 334fc92..54ac764 100644
--- a/.bleep
+++ b/.bleep
@@ -1 +1 @@
-3dd34515725af2df875219491ab8542ecf59bd2b \ No newline at end of file
+b6df57d294b9ccbe3a623b9ccd005e407cacc5a5 \ No newline at end of file
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.
diff --git a/pingora-proxy/src/proxy_cache.rs b/pingora-proxy/src/proxy_cache.rs
index e9914cf..865c592 100644
--- a/pingora-proxy/src/proxy_cache.rs
+++ b/pingora-proxy/src/proxy_cache.rs
@@ -153,6 +153,7 @@ impl<SV> HttpProxy<SV> {
{
// Put the write lock in the request
session.cache.set_write_lock(write_lock);
+ session.cache.tag_as_subrequest();
// and then let it go to upstream
break None;
}