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

feat: Add outgoing request URLs for the subgraph calls in the OTEL spans #2292

Merged
merged 3 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -99,6 +99,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