Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add router metrics for Connectors telemetry configuration #6155

Merged
merged 1 commit into from
Oct 17, 2024
Merged
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
4 changes: 4 additions & 0 deletions apollo-router/src/configuration/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ impl InstrumentData {
"$..events.supergraph",
opt.events.subgraph,
"$..events.subgraph",
opt.events.connector,
"$..events.connector",
opt.instruments,
"$..instruments",
opt.instruments.router,
Expand All @@ -349,6 +351,8 @@ impl InstrumentData {
"$..instruments.supergraph",
opt.instruments.subgraph,
"$..instruments.subgraph",
opt.instruments.connector,
"$..instruments.connector",
opt.instruments.graphql,
"$..instruments.graphql",
opt.instruments.default_attribute_requirement_level,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ expression: "&metrics.non_zero()"
- value: 1
attributes:
opt.events: true
opt.events.connector: true
opt.events.router: true
opt.events.subgraph: true
opt.events.supergraph: true
opt.instruments: true
opt.instruments.connector: true
opt.instruments.default_attribute_requirement_level: false
opt.instruments.graphql: true
opt.instruments.router: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ telemetry:
subgraph_response_data: "$.products[*].price1"
attributes:
subgraph.name: true
connector:
acme.user.not.found:
value: unit
type: counter
unit: count
description: "Count of 404 responses from the user API"
condition:
all:
- eq:
- 404
- connector_http_response_status: code
- eq:
- "user_api"
- connector_source: name
graphql:
list.length: true
field.execution: true
Expand Down Expand Up @@ -174,4 +188,20 @@ telemetry:
attributes:
subgraph.name: true
response_status:
subgraph_response_status: code
subgraph_response_status: code
connector:
# Standard events
request: off
response: info
error: error

# Custom events
connector.response:
message: "Connector response"
level: info
on: response
attributes:
connector.http.method: true
connector.url.template: true
response_status:
connector_http_response_status: code
Loading