Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Remove deprecated `apollo.router.session.count.active` metric

The `apollo.router.session.count.active` up/down counter — deprecated throughout 2.x — has been removed. It measured the number of in-flight GraphQL requests, duplicating the OpenTelemetry-compliant `http.server.active_requests` metric and causing confusion in dashboards that displayed both.

If your dashboards or alerts reference `apollo.router.session.count.active` (exported as `apollo_router_session_count_active` in Prometheus), switch to [`http.server.active_requests`](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/instruments#opentelemetry-standard-instruments), which follows OpenTelemetry semantic conventions and measures the same value.

By [@BobaFetters](https://github.com/BobaFetters) in https://github.com/apollographql/router/pull/ROUTER-1765
14 changes: 0 additions & 14 deletions apollo-router/src/axum_factory/axum_http_server_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,6 @@ impl HttpServerFactory for AxumHttpServerFactory {
configuration.supergraph.path
);

tracing::warn!(
"The `apollo.router.session.count.active` metric is deprecated and may be \
removed in a future release. Switch to the OpenTelemetry-compliant \
`http.server.active_requests` metric instead. See \
https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/standard-instruments#session"
);

// serve extra routers

let listeners_and_routers =
Expand Down Expand Up @@ -407,13 +400,6 @@ async fn handle_graphql<RF: RouterFactory>(
Extension(service_factory): Extension<RF>,
http_request: Request<axum::body::Body>,
) -> impl IntoResponse {
let _guard = i64_up_down_counter_with_unit!(
"apollo.router.session.count.active",
"Amount of in-flight sessions (deprecated, use `http.server.active_requests` instead)",
"{session}",
1
);

let HandlerOptions {
early_cancel,
experimental_log_on_broken_pipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ You can attach custom attributes using [router selectors](/router/configuration/
- `apollo.router.graphql_error` - counts GraphQL errors in responses. Also counts errors which occur during the response validation phase, which are represented in client responses as `extensions.valueCompletion` instead of actual GraphQL errors. Attributes:
- `code`: error code, including `RESPONSE_VALIDATION_FAILED` in the case of a value completion error.

## Session

- `apollo.router.session.count.active` - Number of in-flight GraphQL requests. **Deprecated**: use `http.server.active_requests` instead.

<Note>

`apollo.router.session.count.active` is a legacy Apollo-specific metric. Apollo recommends using [`http.server.active_requests`](/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/instruments#opentelemetry-standard-instruments) instead, which follows OpenTelemetry semantic conventions and is the standard way to measure in-flight HTTP requests. `apollo.router.session.count.active` might be removed in a future release.

</Note>

## Cache

- `apollo.router.cache.size` — Number of entries in the cache
Expand Down
8 changes: 4 additions & 4 deletions examples/telemetry/metric-rename.router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ telemetry:
# Only these attributes will be preserved on the renamed metric

# Example 5: Rename with custom description and unit
- name: apollo.router.session.count.active
rename: custom.active.sessions
description: "Number of active GraphQL sessions"
unit: "{session}"
- name: apollo.router.opened.subscriptions
rename: custom.active.subscriptions
description: "Number of currently open subscriptions"
unit: "{subscription}"

# OTLP exporter - receives renamed metrics
otlp:
Expand Down