Skip to content

Commit eea1db0

Browse files
goto-bus-stoplrlna
authored andcommitted
Submit lifecycle metrics to Apollo (#5270)
1 parent b3fa0e9 commit eea1db0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Submit new metrics to Apollo ([PR #5270](https://github.com/apollographql/router/pull/5270))
2+
3+
The router submits two new metrics to Apollo:
4+
- `apollo.router.lifecycle.api_schema` provides us feedback on the experimental Rust-based API schema generation.
5+
- `apollo.router.lifecycle.license` provides metrics on license expiration. We use this to improve the reliability of the license check mechanism.

apollo-router/src/metrics/filter.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl FilterMeterProvider {
9494
.delegate(delegate)
9595
.allow(
9696
Regex::new(
97-
r"apollo\.(graphos\.cloud|router\.(operations?|config|schema|query|query_planning))(\..*|$)",
97+
r"apollo\.(graphos\.cloud|router\.(operations?|lifecycle|config|schema|query|query_planning))(\..*|$)",
9898
)
9999
.expect("regex should have been valid"),
100100
)
@@ -286,6 +286,10 @@ mod test {
286286
.u64_counter("apollo.router.query_planning.test")
287287
.init()
288288
.add(1, &[]);
289+
filtered
290+
.u64_counter("apollo.router.lifecycle.api_schema")
291+
.init()
292+
.add(1, &[]);
289293
meter_provider.force_flush(&cx).unwrap();
290294

291295
let metrics: Vec<_> = exporter
@@ -308,6 +312,10 @@ mod test {
308312
assert!(!metrics
309313
.iter()
310314
.any(|m| m.name == "apollo.router.unknown.test"));
315+
316+
assert!(metrics
317+
.iter()
318+
.any(|m| m.name == "apollo.router.lifecycle.api_schema"));
311319
}
312320

313321
#[tokio::test(flavor = "multi_thread")]

0 commit comments

Comments
 (0)