Skip to content

Commit e82009f

Browse files
authored
Merge pull request #401 from apollographql/fix/remove-verbose-logging
fix: remove verbose logging
2 parents 156ac61 + 7d35515 commit e82009f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### fix: remove verbose logging - @swcollard PR #401
2+
3+
The tracing-subscriber crate we are using to create logs does not have a configuration to exclude the span name and attributes from the log line. This led to rather verbose logs on app startup which would dump the full operation object into the logs before the actual log line.
4+
5+
This change strips the attributes from the top level spans so that we still have telemetry and tracing during this important work the server is doing, but they don't make it into the logs. The relevant details are provided in child spans after the operation has been parsed so we aren't losing any information other than a large json blob in the top level trace of generating Tools from GraphQL Operations.

crates/apollo-mcp-server/src/operations/operation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl Operation {
4848
self.inner
4949
}
5050

51-
#[tracing::instrument(skip(graphql_schema, custom_scalar_map))]
51+
#[tracing::instrument(skip_all, name = "load_tool")]
5252
pub fn from_document(
5353
raw_operation: RawOperation,
5454
graphql_schema: &GraphqlSchema,

crates/apollo-schema-index/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ pub struct SchemaIndex {
119119
}
120120

121121
impl SchemaIndex {
122+
#[tracing::instrument(skip_all, name = "schema_index")]
122123
pub fn new(
123124
schema: &Valid<Schema>,
124125
root_types: EnumSet<OperationType>,

0 commit comments

Comments
 (0)