diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Extensions/ActivityExtensions.cs b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Extensions/ActivityExtensions.cs index d4ba3fd597f..04d2f4ada89 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Extensions/ActivityExtensions.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Extensions/ActivityExtensions.cs @@ -48,7 +48,8 @@ public void AddGraphQLErrorEvent( IError error, string? operationType = null, string? operationName = null, - string? schemaCoordinate = null) + string? schemaCoordinate = null, + OperationDocumentInfo? documentInfo = null) { var tags = new ActivityTagsCollection { @@ -86,15 +87,8 @@ public void AddGraphQLErrorEvent( tags[SemanticConventions.GraphQL.Document.Locations] = locations; } - if (operationType is not null) - { - tags[SemanticConventions.GraphQL.Operation.Type] = operationType; - } - - if (!string.IsNullOrEmpty(operationName)) - { - tags[SemanticConventions.GraphQL.Operation.Name] = operationName; - } + EnrichOperation(tags, operationType, operationName); + EnrichDocumentInfo(tags, documentInfo); if (error.Exception is { } exception) { @@ -108,9 +102,10 @@ public void AddGraphQLErrorEvent( public void AddGraphQLErrorEvent( Exception exception, - string? operationType = null, + string operationType, string? operationName = null, - string? schemaCoordinate = null) + string? schemaCoordinate = null, + OperationDocumentInfo? documentInfo = null) { var tags = new ActivityTagsCollection { @@ -125,15 +120,8 @@ public void AddGraphQLErrorEvent( tags[SemanticConventions.GraphQL.Field.SchemaCoordinate] = schemaCoordinate; } - if (!string.IsNullOrEmpty(operationType)) - { - tags[SemanticConventions.GraphQL.Operation.Type] = operationType; - } - - if (!string.IsNullOrEmpty(operationName)) - { - tags[SemanticConventions.GraphQL.Operation.Name] = operationName; - } + EnrichOperation(tags, operationType, operationName); + EnrichDocumentInfo(tags, documentInfo); activity.AddEvent(new ActivityEvent("graphql.error", default, tags)); } @@ -220,4 +208,44 @@ public void EnrichOperation(OperationType operationType, string? operationName) } } } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnrichOperation( + ActivityTagsCollection tags, + string? operationType, + string? operationName) + { + if (!string.IsNullOrEmpty(operationType)) + { + tags[SemanticConventions.GraphQL.Operation.Type] = operationType; + } + + if (!string.IsNullOrEmpty(operationName)) + { + tags[SemanticConventions.GraphQL.Operation.Name] = operationName; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnrichDocumentInfo( + ActivityTagsCollection tags, + OperationDocumentInfo? documentInfo) + { + if (documentInfo is null) + { + return; + } + + var hash = documentInfo.Hash; + + if (!hash.IsEmpty) + { + tags[SemanticConventions.GraphQL.Document.Hash] = $"{hash.AlgorithmName}:{hash.Value}"; + } + + if (documentInfo is { IsPersisted: true, Id.HasValue: true }) + { + tags[SemanticConventions.GraphQL.Document.Id] = documentInfo.Id.Value; + } + } } diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/SemanticConventions.cs b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/SemanticConventions.cs index 856217d8649..3960d33556b 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/SemanticConventions.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/SemanticConventions.cs @@ -7,6 +7,12 @@ internal static class SemanticConventions { public const string ErrorType = "error.type"; + public static class Server + { + public const string Address = "server.address"; + public const string Port = "server.port"; + } + public static class GraphQL { public static class Document @@ -81,6 +87,7 @@ public static class TypeValues public const string Resolve = "resolve"; public const string DataLoaderDispatch = "dataloader_dispatch"; public const string DataLoaderBatch = "dataloader_batch"; + public const string SubscriptionEvent = "subscription_event"; } } diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs index 933edadafdf..a0a2a0cb4c1 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using Microsoft.AspNetCore.Http; using HotChocolate.Execution; using HotChocolate.Language; using HotChocolate.Language.Utilities; @@ -37,6 +38,8 @@ protected override void OnComplete() Activity.SetTag(GraphQL.Processing.Type, GraphQL.Processing.TypeValues.Request); } + EnrichServerAttributes(); + string? operationTypeValue = null; string? operationName = null; if (TryGetOperationInfo(out var operationType, out operationName)) @@ -62,7 +65,7 @@ protected override void OnComplete() Activity.SetTag(GraphQL.Error.Count, result.Errors.Count); } - EmitErrorEvents(result.Errors, operationTypeValue, operationName); + EmitErrorEvents(result.Errors, operationTypeValue, operationName, documentInfo); } if (Context.Result is null or OperationResult { Errors: [_, ..] }) @@ -86,10 +89,41 @@ protected override void OnComplete() enricher.EnrichExecuteRequest(Context, Activity); } + private void EnrichServerAttributes() + { + if (!Context.Features.TryGet(out var httpContext)) + { + return; + } + + var request = httpContext.Request; + if (!request.Host.HasValue) + { + return; + } + + if (!string.IsNullOrEmpty(request.Host.Host) + && Activity.GetTagItem(SemanticConventions.Server.Address) is null) + { + Activity.SetTag(SemanticConventions.Server.Address, request.Host.Host); + } + + if (request.Host.Port is { } port + && Activity.GetTagItem(SemanticConventions.Server.Port) is null) + { + var defaultPort = request.IsHttps ? 443 : 80; + if (port != defaultPort) + { + Activity.SetTag(SemanticConventions.Server.Port, port); + } + } + } + private void EmitErrorEvents( IReadOnlyList errors, string? operationType, - string? operationName) + string? operationName, + OperationDocumentInfo documentInfo) { var maxEvents = options.MaxErrorEvents; if (maxEvents <= 0 || errors.Count == 0) @@ -100,7 +134,11 @@ private void EmitErrorEvents( var limit = errors.Count < maxEvents ? errors.Count : maxEvents; for (var i = 0; i < limit; i++) { - Activity.AddGraphQLErrorEvent(errors[i], operationType, operationName); + Activity.AddGraphQLErrorEvent( + errors[i], + operationType, + operationName, + documentInfo: documentInfo); } } } diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/SubscriptionEventSpan.cs b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/SubscriptionEventSpan.cs index 31e83e1e6e5..58838bc3cef 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/SubscriptionEventSpan.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/SubscriptionEventSpan.cs @@ -24,7 +24,7 @@ internal sealed class SubscriptionEventSpan(Activity activity) : SpanBase(activi return null; } - activity.SetTag(GraphQL.Processing.Type, GraphQL.Processing.TypeValues.Execute); + activity.SetTag(GraphQL.Processing.Type, GraphQL.Processing.TypeValues.SubscriptionEvent); activity.EnrichOperation(OperationType.Subscription, operationName); activity.EnrichDocumentInfo(context.OperationDocumentInfo); activity.SetTag(GraphQL.Subscription.Id, subscriptionId.ToString(CultureInfo.InvariantCulture)); diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/VariableCoercionSpan.cs b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/VariableCoercionSpan.cs index 3721c730a7c..022c14651d3 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/VariableCoercionSpan.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/VariableCoercionSpan.cs @@ -34,7 +34,15 @@ internal sealed class VariableCoercionSpan( protected override void OnComplete() { - if (context.VariableValues.Length > 0) + // The pipeline assigns `RequestContext.VariableValues` only when + // coercion completes successfully. A length of zero therefore means + // the coercion threw before the values were committed. + if (context.VariableValues.Length == 0) + { + Activity.SetStatus(ActivityStatusCode.Error); + Activity.SetErrorType(ActivityExtensions.ExecutionErrorType); + } + else if (Activity.Status != ActivityStatusCode.Error) { Activity.SetStatus(ActivityStatusCode.Ok); } diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics/InstrumentationOptions.cs b/src/HotChocolate/Diagnostics/src/Diagnostics/InstrumentationOptions.cs index 1da0a36eb94..6ae31b7804d 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics/InstrumentationOptions.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics/InstrumentationOptions.cs @@ -17,6 +17,14 @@ public sealed class InstrumentationOptions : InstrumentationOptionsBase /// public bool IncludeDataLoaderKeys { get; set; } + /// + /// Specifies whether the diagnostic listener participates in field resolver + /// instrumentation. When set to false, the GraphQL execution engine + /// skips the resolver instrumentation hook entirely, avoiding any per-field + /// overhead. The default is true. + /// + public bool EnableResolveFieldValue { get; set; } = true; + internal bool SkipExecuteHttpRequest => (Scopes & ExecuteHttpRequest) != ExecuteHttpRequest; internal bool SkipParseHttpRequest => (Scopes & ParseHttpRequest) != ParseHttpRequest; diff --git a/src/HotChocolate/Diagnostics/src/Diagnostics/Listeners/ActivityExecutionDiagnosticListener.cs b/src/HotChocolate/Diagnostics/src/Diagnostics/Listeners/ActivityExecutionDiagnosticListener.cs index a83c8aef34d..ee1cc02ef7f 100644 --- a/src/HotChocolate/Diagnostics/src/Diagnostics/Listeners/ActivityExecutionDiagnosticListener.cs +++ b/src/HotChocolate/Diagnostics/src/Diagnostics/Listeners/ActivityExecutionDiagnosticListener.cs @@ -17,7 +17,7 @@ internal sealed class ActivityExecutionDiagnosticListener( private static readonly AsyncLocal s_currentSubscriptionEventSpan = new(); - public override bool EnableResolveFieldValue => true; + public override bool EnableResolveFieldValue => options.EnableResolveFieldValue; public override IDisposable ExecuteRequest(RequestContext context) { @@ -268,7 +268,8 @@ public override void ResolverError(IMiddlewareContext context, IError error) operationType: SemanticConventions.GraphQL.Operation.TypeValues[ context.Operation.Definition.Operation], operationName: context.Operation.Name, - schemaCoordinate: context.Selection.Field.Coordinate.ToString()); + schemaCoordinate: context.Selection.Field.Coordinate.ToString(), + documentInfo: context.Features.Get()); } } @@ -352,7 +353,14 @@ public override void DocumentNotFoundInStorage(RequestContext context, Operation { if (context.Features.TryGet(out var span)) { - span.Activity.AddEvent(new(nameof(DocumentNotFoundInStorage))); + var tags = new ActivityTagsCollection(); + + if (documentId.HasValue) + { + tags[SemanticConventions.GraphQL.Document.Id] = documentId.Value; + } + + span.Activity.AddEvent(new ActivityEvent(nameof(DocumentNotFoundInStorage), default, tags)); enricher.EnrichDocumentNotFoundInStorage(context, documentId, span.Activity); } } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs index d13c8d41c49..95362f24239 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs @@ -1,5 +1,7 @@ +using System.Text.Json; using Microsoft.Extensions.DependencyInjection; using HotChocolate.Execution; +using HotChocolate.Features; using HotChocolate.Language; using HotChocolate.PersistedOperations; using HotChocolate.Resolvers; @@ -456,6 +458,29 @@ public async Task DataLoader_BatchExecution_With_Keys_RecordsBatchSpan() } } + [Fact] + public async Task VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan() + { + using (CaptureActivities(out var activities)) + { + // arrange & act + await new ServiceCollection() + .AddGraphQL() + .AddInstrumentation(o => o.Scopes = ActivityScopes.All) + .AddQueryType() + .AddType() + .ExecuteRequestAsync( + OperationRequestBuilder.New() + .SetDocument("query($mood: Mood!) { greetMood(mood: $mood) }") + .SetVariableValues( + new Dictionary { { "mood", "happy" } }) + .Build()); + + // assert + activities.MatchSnapshot(); + } + } + [Fact] public async Task VariableCoercion_WithAllScopes_RecordsCoercionSpan() { @@ -640,6 +665,28 @@ public IEnumerable FailingItems(int count) => dataLoader.LoadAsync(key); } + public sealed class MoodScalarType : StringType + { + public MoodScalarType() + : base("Mood") + { + } + + protected override string OnCoerceInputLiteral(StringValueNode valueLiteral) + => throw new FormatException( + $"'{valueLiteral.Value}' is not a recognized mood."); + + protected override string OnCoerceInputValue(JsonElement inputValue, IFeatureProvider context) + => throw new FormatException( + $"'{inputValue.GetString()}' is not a recognized mood."); + } + + public class MoodQuery + { + public string GreetMood([GraphQLType] string mood) + => $"Greetings, {mood}!"; + } + public class FailingItem(int index) { public int Index { get; } = index; diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap index cadca2a10d8..80e4427c337 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap @@ -69,6 +69,10 @@ { "Key": "graphql.operation.name", "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap index 2c6615c0f4d..11a0218b832 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap @@ -25,7 +25,12 @@ "event": [ { "Name": "DocumentNotFoundInStorage", - "Tags": [] + "Tags": [ + { + "Key": "graphql.document.id", + "Value": "a8c5e2f1d3b4a6e7c9d0f1a2b3c4d5e6" + } + ] }, { "Name": "graphql.error", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap index 7ec6ff1ee4c..3eb41ae9ca1 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap @@ -46,6 +46,10 @@ "column": 27 } ] + }, + { + "Key": "graphql.document.hash", + "Value": "md5:bb1d246465341a97bdc727d6cd8ead5c" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithExtensionsCode_SetsErrorTypeFromCode.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithExtensionsCode_SetsErrorTypeFromCode.snap index e12569e0fd1..e58a55a41e5 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithExtensionsCode_SetsErrorTypeFromCode.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithExtensionsCode_SetsErrorTypeFromCode.snap @@ -57,6 +57,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b8c29c6e4a2bbe7edee752c4f7cb0f7a" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithoutExtensionsCode_FallsBackToExecutionError.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithoutExtensionsCode_FallsBackToExecutionError.snap index c157dd50ba1..9ae0f8ba604 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithoutExtensionsCode_FallsBackToExecutionError.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithoutExtensionsCode_FallsBackToExecutionError.snap @@ -53,6 +53,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:eb7651f0968bfe850896354cd6bcbd0d" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.MaxErrorEvents_CapsErrorEventsOnRootSpan.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.MaxErrorEvents_CapsErrorEventsOnRootSpan.snap index 7d708404b8f..155f24247bc 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.MaxErrorEvents_CapsErrorEventsOnRootSpan.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.MaxErrorEvents_CapsErrorEventsOnRootSpan.snap @@ -57,6 +57,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6f0e26cc72109e7fbfd007a087361e6b" } ] }, @@ -78,6 +82,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6f0e26cc72109e7fbfd007a087361e6b" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap index 918b5af9694..2d0ad822d40 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap @@ -63,6 +63,10 @@ "column": 11 } ] + }, + { + "Key": "graphql.document.hash", + "Value": "md5:bb507ba78696fc3c6ff3a17fb06784d5" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_AtRootLevel_MarksOperationAsError.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_AtRootLevel_MarksOperationAsError.snap index 7d3ebcb60bc..0a4a025ee42 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_AtRootLevel_MarksOperationAsError.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_AtRootLevel_MarksOperationAsError.snap @@ -61,6 +61,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ae3f9af1d2570e25f30a1ad002172b82" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_DeepInTree_MarksNestedFieldAsError.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_DeepInTree_MarksNestedFieldAsError.snap index c008e5c6516..a7f036da6f3 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_DeepInTree_MarksNestedFieldAsError.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverError_DeepInTree_MarksNestedFieldAsError.snap @@ -61,6 +61,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6a77818c7c3e27e4476f1b3cbd2b5475" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap index 5a51853a6a8..2d88efaec71 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap @@ -54,6 +54,10 @@ "Key": "graphql.operation.type", "Value": "query" }, + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + }, { "Key": "exception.type", "Value": "System.InvalidOperationException" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap index c2cc9edaf4a..0ae8d386e70 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap @@ -125,7 +125,7 @@ "tags": [ { "Key": "graphql.processing.type", - "Value": "execute" + "Value": "subscription_event" }, { "Key": "graphql.operation.type", @@ -172,6 +172,10 @@ "Key": "graphql.operation.name", "Value": "OnFailingMessageSubscription" }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + }, { "Key": "exception.type", "Value": "System.InvalidOperationException" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap index e9a7c449d0d..d55bdfdb207 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap @@ -125,7 +125,7 @@ "tags": [ { "Key": "graphql.processing.type", - "Value": "execute" + "Value": "subscription_event" }, { "Key": "graphql.operation.type", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap index ed01f5ef1f8..050e858e079 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap @@ -42,6 +42,10 @@ "column": 3 } ] + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1526f207d516803b71eb8a0db419b57b" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap new file mode 100644 index 00000000000..52af1eb5156 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap @@ -0,0 +1,169 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "error.type", + "Value": "HotChocolate.Types.LeafCoercionException" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.error.count", + "Value": 1 + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "exception", + "Tags": [ + { + "Key": "exception.message", + "Value": "Mood cannot coerce the given value JSON element of type `String` to a runtime value." + }, + { + "Key": "exception.stacktrace", + "Value": "HotChocolate.Types.LeafCoercionException: Mood cannot coerce the given value JSON element of type `String` to a runtime value.\n at HotChocolate.Types.InputParser.DeserializeLeaf(JsonElement inputValue, ILeafType type, Path path, InputField field, IFeatureProvider context) in InputParser.cs\n at HotChocolate.Types.InputParser.Deserialize(JsonElement inputValue, IType type, Path path, InputField field, IFeatureProvider context) in InputParser.cs\n at HotChocolate.Types.InputParser.ParseInputValue(JsonElement inputValue, IType type, IFeatureProvider context, Path path) in InputParser.cs\n at HotChocolate.Execution.Processing.VariableCoercionHelper.CoerceVariableValue(VariableDefinitionNode variableDefinition, IInputType variableType, JsonElement inputValue, IFeatureProvider context) in VariableCoercionHelper.cs\n at HotChocolate.Execution.Processing.VariableCoercionHelper.CoerceVariableValuesInternal(ISchemaDefinition schema, IReadOnlyList`1 variableDefinitions, JsonElement variableValues, Dictionary`2 coercedValues, IFeatureProvider context) in VariableCoercionHelper.cs\n at HotChocolate.Execution.Processing.VariableCoercionHelper.CoerceVariableValues(ISchemaDefinition schema, IReadOnlyList`1 variableDefinitions, JsonElement variableValues, Dictionary`2 coercedValues, IFeatureProvider context) in VariableCoercionHelper.cs\n at HotChocolate.Execution.Pipeline.PipelineTools.CoerceVariables(RequestContext context, VariableCoercionHelper coercionHelper, IReadOnlyList`1 variableDefinitions, IExecutionDiagnosticEvents diagnosticEvents) in PipelineTools.cs\n at HotChocolate.Execution.Pipeline.OperationVariableCoercionMiddleware.InvokeAsync(RequestContext context) in OperationVariableCoercionMiddleware.cs\n at HotChocolate.Execution.Pipeline.SkipWarmupExecutionMiddleware.InvokeAsync(RequestContext context) in SkipWarmupExecutionMiddleware.cs\n at HotChocolate.Execution.Pipeline.OperationResolverMiddleware.InvokeAsync(RequestContext context) in OperationResolverMiddleware.cs\n at HotChocolate.Execution.Pipeline.OperationCacheMiddleware.InvokeAsync(RequestContext context) in OperationCacheMiddleware.cs\n at HotChocolate.Execution.Pipeline.DocumentValidationMiddleware.InvokeAsync(RequestContext context) in DocumentValidationMiddleware.cs\n at HotChocolate.Execution.Pipeline.DocumentParserMiddleware.InvokeAsync(RequestContext context) in DocumentParserMiddleware.cs\n at HotChocolate.Execution.Pipeline.DocumentCacheMiddleware.InvokeAsync(RequestContext context) in DocumentCacheMiddleware.cs\n at HotChocolate.Execution.Pipeline.TimeoutMiddleware.InvokeAsync(RequestContext context) in TimeoutMiddleware.cs\n at HotChocolate.Execution.Pipeline.ExceptionMiddleware.InvokeAsync(RequestContext context) in ExceptionMiddleware.cs" + }, + { + "Key": "exception.type", + "Value": "HotChocolate.Types.LeafCoercionException" + } + ] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Mood cannot coerce the given value JSON element of type `String` to a runtime value." + }, + { + "Key": "graphql.field.path", + "Value": "mood" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "exception.type", + "Value": "System.FormatException" + }, + { + "Key": "exception.message", + "Value": "'happy' is not a recognized mood." + }, + { + "Key": "exception.stacktrace", + "Value": "System.FormatException: 'happy' is not a recognized mood.\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.MoodScalarType.OnCoerceInputValue(JsonElement inputValue, IFeatureProvider context) in ActivityExecutionDiagnosticListenerTests.cs\n at HotChocolate.Types.ScalarType`2.CoerceInputValue(JsonElement inputValue, IFeatureProvider context) in ScalarType~2.cs" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap index 880a7f4379a..d129fc11236 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap @@ -46,6 +46,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap index 65da759c667..933dce70b1f 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap @@ -54,6 +54,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap index e17fdbbd266..18cf1d23710 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap @@ -50,6 +50,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built.snap index cd2ceaf8439..a7592b1a5cf 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built.snap @@ -50,6 +50,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap index e69bb6db42b..2aed841da59 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap @@ -50,6 +50,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap index b6e6c9d15be..e3e65177d0e 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap @@ -33,6 +33,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap index 716d88510b1..d3f0cf25da3 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap @@ -50,6 +50,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap index 02d2e62bf43..36da6252463 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap @@ -54,6 +54,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap index 06717cf1040..63bd832f673 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap @@ -62,6 +62,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap index 327cb935c3f..7411285cc10 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap @@ -54,6 +54,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap index 181eac0e14b..8651caf6c10 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap @@ -46,6 +46,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap index 24e045678ad..09518c97e99 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap @@ -38,6 +38,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/src/Fusion.Diagnostics/Listeners/FusionActivityExecutionDiagnosticEventListener.cs b/src/HotChocolate/Fusion/src/Fusion.Diagnostics/Listeners/FusionActivityExecutionDiagnosticEventListener.cs index d1ac010fbf9..5d1f3937bf0 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Diagnostics/Listeners/FusionActivityExecutionDiagnosticEventListener.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Diagnostics/Listeners/FusionActivityExecutionDiagnosticEventListener.cs @@ -227,7 +227,8 @@ public override void ExecutionNodeError( activity.AddGraphQLErrorEvent( error, operationType: GetOperationType(context), - operationName: context.OperationPlan.Operation.Name); + operationName: context.OperationPlan.Operation.Name, + documentInfo: context.RequestContext.OperationDocumentInfo); activity.SetErrorType(error); enricher.EnrichExecutionNodeError(context, node, error, activity); @@ -246,7 +247,8 @@ public override void SourceSchemaTransportError( activity.AddGraphQLErrorEvent( error, operationType: GetOperationType(context), - operationName: context.OperationPlan.Operation.Name); + operationName: context.OperationPlan.Operation.Name, + documentInfo: context.RequestContext.OperationDocumentInfo); activity.SetErrorType(error); enricher.EnrichSourceSchemaTransportError(context, node, schemaName, error, activity); @@ -265,7 +267,8 @@ public override void SourceSchemaStoreError( activity.AddGraphQLErrorEvent( error, operationType: GetOperationType(context), - operationName: context.OperationPlan.Operation.Name); + operationName: context.OperationPlan.Operation.Name, + documentInfo: context.RequestContext.OperationDocumentInfo); activity.SetErrorType(error); enricher.EnrichSourceSchemaStoreError(context, node, schemaName, error, activity); @@ -312,7 +315,8 @@ public override void SubscriptionEventError( activity.AddGraphQLErrorEvent( exception, operationType: GetOperationType(context), - operationName: context.OperationPlan.Operation.Name); + operationName: context.OperationPlan.Operation.Name, + documentInfo: context.RequestContext.OperationDocumentInfo); activity.SetErrorType(exception); enricher.EnrichSubscriptionEventError( @@ -345,7 +349,14 @@ public override void DocumentNotFoundInStorage(RequestContext context, Operation { if (context.Features.TryGet(out var span)) { - span.Activity.AddEvent(new(nameof(DocumentNotFoundInStorage))); + var tags = new ActivityTagsCollection(); + + if (documentId.HasValue) + { + tags[SemanticConventions.GraphQL.Document.Id] = documentId.Value; + } + + span.Activity.AddEvent(new ActivityEvent(nameof(DocumentNotFoundInStorage), default, tags)); enricher.EnrichDocumentNotFoundInStorage(context, documentId, span.Activity); } } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs index 86ebac0ef79..6ab6e14738d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using HotChocolate.Execution; +using HotChocolate.Features; using HotChocolate.Language; using HotChocolate.PersistedOperations; using HotChocolate.Resolvers; @@ -409,6 +411,41 @@ public async Task DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans() } } + [Fact] + public async Task VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan() + { + using (CaptureActivities(out var activities)) + { + // arrange + using var server1 = CreateSourceSchema( + "a", + b => b + .AddQueryType() + .AddType()); + + using var gateway = await CreateCompositeSchemaAsync( + [ + ("a", server1) + ], + configureGatewayBuilder: b => b.AddInstrumentation(o => + o.Scopes = FusionActivityScopes.All)); + + var executor = await gateway.Services.GetRequestExecutorAsync(); + + var request = OperationRequestBuilder.New() + .SetDocument("query($mood: Mood!) { greetMood(mood: $mood) }") + .SetVariableValues( + new Dictionary { { "mood", "happy" } }) + .Build(); + + // act + await executor.ExecuteAsync(request); + + // assert + activities.MatchSnapshot(); + } + } + [Fact] public async Task AllScopes_IncludesAllSpans() { @@ -741,6 +778,25 @@ public string CauseFatalError(IResolverContext context) .Build()); public Deep Deep() => new(); + + public string GreetMood([GraphQLType] string mood) + => $"Greetings, {mood}!"; + } + + public sealed class MoodScalarType : StringType + { + public MoodScalarType() + : base("Mood") + { + } + + protected override string OnCoerceInputLiteral(StringValueNode valueLiteral) + => throw new FormatException( + $"'{valueLiteral.Value}' is not a recognized mood."); + + protected override string OnCoerceInputValue(JsonElement inputValue, IFeatureProvider context) + => throw new FormatException( + $"'{inputValue.GetString()}' is not a recognized mood."); } [GraphQLName("Query")] diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap index 4f8a1db8580..ba96760aef7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap @@ -69,6 +69,10 @@ { "Key": "graphql.operation.name", "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" } ] } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap index 90235ee9ee7..1eb5cb3a136 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap @@ -25,7 +25,12 @@ "event": [ { "Name": "DocumentNotFoundInStorage", - "Tags": [] + "Tags": [ + { + "Key": "graphql.document.id", + "Value": "a8c5e2f1d3b4a6e7c9d0f1a2b3c4d5e6" + } + ] }, { "Name": "graphql.error", diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap index 2b876737a67..c62c713ca12 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap @@ -46,6 +46,10 @@ "column": 27 } ] + }, + { + "Key": "graphql.document.hash", + "Value": "md5:bb1d246465341a97bdc727d6cd8ead5c" } ] } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError.snap index 0dd2d044366..57fc6043ec7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError.snap @@ -61,6 +61,10 @@ { "Key": "graphql.operation.type", "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" } ] } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap index 53a8b38c0a5..a46eabfbc8a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap @@ -63,6 +63,10 @@ "column": 11 } ] + }, + { + "Key": "graphql.document.hash", + "Value": "md5:bb507ba78696fc3c6ff3a17fb06784d5" } ] } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error.snap index de65b4a956a..30d889cd6fc 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error.snap @@ -66,6 +66,10 @@ "Key": "graphql.operation.name", "Value": "SayHelloQuery" }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + }, { "Key": "exception.type", "Value": "System.Net.Http.HttpRequestException" @@ -244,6 +248,10 @@ { "Key": "graphql.operation.name", "Value": "SayHelloQuery" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" } ] } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap index eb81a14f38d..795bb8e40b3 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap @@ -176,7 +176,7 @@ "tags": [ { "Key": "graphql.processing.type", - "Value": "execute" + "Value": "subscription_event" }, { "Key": "graphql.operation.type", diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap index cd6f73c13fb..ab81ca7682e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap @@ -42,6 +42,10 @@ "column": 3 } ] + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1526f207d516803b71eb8a0db419b57b" } ] } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap new file mode 100644 index 00000000000..535351d0374 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap @@ -0,0 +1,212 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Mood cannot coerce the given value JSON element of type `String` to a runtime value." + }, + { + "Key": "graphql.field.path", + "Value": "greetMood" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "2e1b1885ffe6f212546fa4bd4f1343545db562aa93c24e02c85024bb1e4bbae0" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_6e783865_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:0dfa0a2d24c8e4422563d556aea9ab42b677dda1a9d54f60176f8fe0b5ffb527" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap index 122307b5c8d..8895d0440c9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap @@ -46,6 +46,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap index e90c1df8c1b..63c4111df9e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap @@ -54,6 +54,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap index 282a6db2e2f..90727a23498 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap @@ -50,6 +50,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap index f6b1b9d5f7f..2347c6b9524 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap @@ -33,6 +33,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap index bdb3bad2b77..d05b41c09c5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap @@ -50,6 +50,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap index 7256bd52f08..a5e00944561 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap @@ -54,6 +54,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap index ee17b23ed8b..a2e386b589c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap @@ -62,6 +62,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap index 3eaa62d4789..45cdf32d302 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap @@ -54,6 +54,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap index 2891c74fdef..fbaa6feb478 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap @@ -46,6 +46,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query" diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap index 89cea31500a..b4755a2c3e7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap @@ -38,6 +38,14 @@ "Key": "graphql.processing.type", "Value": "request" }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, { "Key": "graphql.operation.type", "Value": "query"