Error Info Missing From FTV1 Federated Trace Data
- 主要语言
- Go
- 星标
- 10.8k
- 派生
- 1.3k
- 平均合并
- 2 天 36 分钟
- 30 天内合并 PR
- 26
描述
### What happened?
We use Apollo GraphOS and have a federated supergraph with a number of subgraphs implemented with gqlgen. We are expecting to see some error details in GraphOS and after conferring with the Apollo team it seems like that information isn't being provided in the `ftv1` extension data which is needed for display in Apollo GraphOS.
From the [Apollo documentation](https://www.apollographql.com/docs/graphos/routing/graphos-reporting#errors) it states:
> Your subgraph libraries must support federated tracing (also known as FTV1 tracing) to provide errors to GraphOS.
Example from the Apollo guys, not related to the sample data below:

### What did you expect?
We'd expect that any errors reported as GraphQL errors during resolver execution would also make their way in to the `ftv1` extension data.
See the example data below. The `error` arrays are all empty.
### Minimal graphql.schema and models to reproduce
The subgraph response from the gqlgen subraph:
```json
{
"timestamp": "2024-12-02T10:24:02.809833046Z",
"level": "INFO",
"trace_id": "...",
"span_id": "...",
"message": "Raw response body from subgraph \"asset-search\" received",
"response.body": {
"errors": [
{
"message": "",
"path": ["assetSearch"],
"extensions": {
"code": 401
}
}
],
"data": null,
"extensions": {
"ftv1": "GgwIwpW2ugYQ79TCgQMiDAjClba6BhDp0fXWAliGg80qcjBiLhoQQXNzZXRDb25uZWN0aW9uIUDjiAdI3owHagVRdWVyeQoLYXNzZXRTZWFyY2g="
}
},
"apollo.subgraph.name": "asset-search",
"target": "apollo_router::services::subgraph_service",
"spans": [
{
"http.route": "/graphql",
"http.request.method": "POST",
"http.request.body.size": "131",
"network.protocol.version": "HTTP/1.1",
"network.type": "ipv4",
"client.address": "...",
"server.address": "...",
"server.port": "4000",
"url.path": "/graphql",
"user_agent.original": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
"trace_id": "...",
"client.name": "",
"client.version": "",
"name": "router"
},
{
"name": "supergraph"
},
{
"graphql.operation.type": "query",
"name": "execution"
},
{
"apollo.subgraph.name": "asset-search",
"name": "fetch"
},
{
"subgraph.graphql.document": "query TestQuery__asset_search__0{assetSearch{totalCount}}",
"subgraph.graphql.operation.name": "TestQuery__asset_search__0",
"subgraph.graphql.operation.type": "query",
"subgraph.name": "asset-search",
"name": "subgraph"
}
],
"resource": {
"service.name": "apollo-router",
"process.executable.name": "router",
"service.version": "1.57.1"
}
}
```
The `ftv1` proto decoded:
```json
{
"end_time": {
"seconds": 1733135042,
"nanos": 808495727
},
"start_time": {
"seconds": 1733135042,
"nanos": 719153385
},
"details": null,
"client_name": "",
"client_version": "",
"http": null,
"duration_ns": 89342342,
"root": {
"error": [],
"child": [
{
"error": [],
"child": [],
"type": "AssetConnection!",
"cache_policy": null,
"start_time": 115811,
"end_time": 116318,
"parent_type": "Query",
"original_field_name": "",
"response_name": "assetSearch"
}
],
"type": "",
"cache_policy": null,
"start_time": 0,
"end_time": 0,
"parent_type": "",
"original_field_name": ""
},
"cache_policy": null,
"signature": "",
"full_query_cache_hit": false,
"persisted_query_hit": false,
"persisted_query_register": false,
"registered_operation": false,
"forbidden_operation": false,
"query_plan": null,
"unexecutedOperationBody": "",
"unexecutedOperationName": "",
"field_execution_weight": 0,
"is_incomplete": false
}
```
### versions
- `github.com/99designs/gqlgen v0.17.55`
- `go 1.22.5`
贡献指南
评估
这个 Issue 还没有评估数据。