Skip to content

Commit 3a538b4

Browse files
committed
fix: update metrics recording to include tenant context
- Modified metrics recording functions in the `Documents` implementation to include a tenant context, specifically using "public" for document read, write, and conflict metrics. - This change enhances the clarity of metrics related to document operations in a multi-tenant environment.
1 parent 61f463a commit 3a538b4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/documents.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl Documents {
5353
return Ok(None);
5454
}
5555
let doc: T = serde_json::from_value(value)?;
56-
metrics::record_doc_read(None);
56+
metrics::record_doc_read(Some("public"));
5757
Ok(Some((doc, version)))
5858
} else {
5959
Ok(None)
@@ -82,7 +82,7 @@ impl Documents {
8282
metrics::record_doc_write(None, 1);
8383
Ok(ver + 1)
8484
} else {
85-
metrics::record_doc_conflict(None);
85+
metrics::record_doc_conflict(Some("public"));
8686
Err(Error::DocVersionConflict)
8787
}
8888
}
@@ -193,10 +193,10 @@ impl Documents {
193193

194194
let query = qb.build_query_as::<(i32,)>();
195195
if let Some((new_ver,)) = query.fetch_optional(&self.pool).await? {
196-
metrics::record_doc_write(None, 1);
196+
metrics::record_doc_write(Some("public"), 1);
197197
Ok(new_ver)
198198
} else if expected.is_some() {
199-
metrics::record_doc_conflict(None);
199+
metrics::record_doc_conflict(Some("public"));
200200
Err(Error::DocVersionConflict)
201201
} else {
202202
Err(Error::DocNotFound)

0 commit comments

Comments
 (0)