Skip to content

Commit

Permalink
Add router metrics for Connectors telemetry configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
pubmodmatt committed Oct 15, 2024
1 parent 408ac64 commit ff5675e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
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

0 comments on commit ff5675e

Please sign in to comment.