Skip to content

Commit

Permalink
feat(apollo-router): add support for GraphOS Cloud metrics (#3761)
Browse files Browse the repository at this point in the history
Fixes #3760
  • Loading branch information
nmoutschen authored Sep 6, 2023
1 parent 07e6959 commit 8359764
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changesets/maint_nicolas_otlp_filter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Add support GraphOS Cloud metrics ([Issue #3760](https://github.com/apollographql/router/issues/3760))

Add support for GraphOS Cloud metrics in the Apollo OTLP Exporter.

By [@nmoutschen](https://github.com/nmoutschen) in https://github.com/apollographql/router/pull/3761
9 changes: 8 additions & 1 deletion apollo-router/src/plugins/telemetry/metrics/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<T: MeterProvider> FilterMeterProvider<T> {
FilterMeterProvider::builder()
.delegate(delegate)
.allow(
Regex::new(r"apollo\.router\.(operations?|config)(\..*|$)")
Regex::new(r"apollo\.(graphos\.cloud|router\.(operations?|config))(\..*|$)")
.expect("regex should have been valid"),
)
.build()
Expand Down Expand Up @@ -212,6 +212,7 @@ mod test {
.versioned_meter("filtered", None, None);
filtered.u64_counter("apollo.router.operations").init();
filtered.u64_counter("apollo.router.operations.test").init();
filtered.u64_counter("apollo.graphos.cloud.test").init();
filtered.u64_counter("apollo.router.unknown.test").init();
assert!(delegate
.instrument_provider
Expand All @@ -225,6 +226,12 @@ mod test {
.lock()
.unwrap()
.contains(&("apollo.router.operations".to_string(), None, None)));
assert!(delegate
.instrument_provider
.counters_created
.lock()
.unwrap()
.contains(&("apollo.graphos.cloud.test".to_string(), None, None)));
assert!(!delegate
.instrument_provider
.counters_created
Expand Down

0 comments on commit 8359764

Please sign in to comment.