Skip to content
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
6 changes: 6 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ By [@neominik](https://github.com/neominik) in https://github.com/apollographql/

## 🛠 Maintenance

### Add outgoing request URLs for the subgraph calls in the OTEL spans ([Issue #2280](https://github.com/apollographql/router/issues/2280))

Add attribute named `http.url` containing the subgraph URL in span `subgraph_request`.

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/2291

### Return more consistent errors ([Issue #2101](https://github.com/apollographql/router/issues/2101))

Change some of our errors we returned by following [this specs](https://www.apollographql.com/docs/apollo-server/data/errors/). It adds a `code` field in `extensions` describing the current error.
Expand Down
3 changes: 2 additions & 1 deletion apollo-router/src/services/subgraph_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl tower::Service<crate::SubgraphRequest> for SubgraphService {
);
});

let schema_uri = request.uri();
let schema_uri = request.uri().clone();
let host = schema_uri.host().map(String::from).unwrap_or_default();
let port = schema_uri.port_u16().unwrap_or_else(|| {
let scheme = schema_uri.scheme_str();
Expand Down Expand Up @@ -177,6 +177,7 @@ impl tower::Service<crate::SubgraphRequest> for SubgraphService {
"net.peer.name" = &display(host),
"net.peer.port" = &display(port),
"http.route" = &display(path),
"http.url" = &display(schema_uri),
"net.transport" = "ip_tcp",
"apollo.subgraph.name" = %service_name
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ expression: get_spans()
"http.route",
"/"
],
[
"http.url",
"https://products.demo.starstuff.dev/"
],
[
"net.transport",
"ip_tcp"
Expand All @@ -416,6 +420,7 @@ expression: get_spans()
"net.peer.name",
"net.peer.port",
"http.route",
"http.url",
"net.transport",
"apollo.subgraph.name"
]
Expand Down Expand Up @@ -625,6 +630,10 @@ expression: get_spans()
"http.route",
"/"
],
[
"http.url",
"https://reviews.demo.starstuff.dev/"
],
[
"net.transport",
"ip_tcp"
Expand All @@ -645,6 +654,7 @@ expression: get_spans()
"net.peer.name",
"net.peer.port",
"http.route",
"http.url",
"net.transport",
"apollo.subgraph.name"
]
Expand Down Expand Up @@ -878,6 +888,10 @@ expression: get_spans()
"http.route",
"/"
],
[
"http.url",
"https://products.demo.starstuff.dev/"
],
[
"net.transport",
"ip_tcp"
Expand All @@ -898,6 +912,7 @@ expression: get_spans()
"net.peer.name",
"net.peer.port",
"http.route",
"http.url",
"net.transport",
"apollo.subgraph.name"
]
Expand Down Expand Up @@ -1109,6 +1124,10 @@ expression: get_spans()
"http.route",
"/"
],
[
"http.url",
"https://accounts.demo.starstuff.dev/"
],
[
"net.transport",
"ip_tcp"
Expand All @@ -1129,6 +1148,7 @@ expression: get_spans()
"net.peer.name",
"net.peer.port",
"http.route",
"http.url",
"net.transport",
"apollo.subgraph.name"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ expression: get_spans()
"http.route",
"/"
],
[
"http.url",
"https://products.demo.starstuff.dev/"
],
[
"net.transport",
"ip_tcp"
Expand All @@ -394,6 +398,7 @@ expression: get_spans()
"net.peer.name",
"net.peer.port",
"http.route",
"http.url",
"net.transport",
"apollo.subgraph.name"
]
Expand Down