Skip to content

Commit

Permalink
Document GraphQLTelemetryProvider.SourceName (#3948)
Browse files Browse the repository at this point in the history
* Document GraphQLTelemetryProvider.SourceName

* Update src/GraphQL/Extensions/GraphQLBuilderExtensions.cs

Co-authored-by: Shane Krueger <[email protected]>

---------

Co-authored-by: Shane Krueger <[email protected]>
  • Loading branch information
gao-artur and Shane32 committed Jun 2, 2024
1 parent 692ef10 commit 72a9775
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/GraphQL/Extensions/GraphQLBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,15 @@ public static IGraphQLBuilder AddExecutionStrategy<TExecutionStrategy>(this IGra
/// </summary>
/// <remarks>
/// When applicable, place after calls to UseAutomaticPersistedQueries to ensure that the query document is recorded properly.
/// <br/>
/// To instruct OpenTelemetry SDK to collect the traces produced by GraphQL.NET register the
/// '<see cref="GraphQLTelemetryProvider.SourceName"/>' source name with the TracerProviderBuilder.
/// <code>
/// services
/// .AddOpenTelemetry()
/// .WithTracing(tracing =&gt; tracing
/// .AddSource(GraphQLTelemetryProvider.SourceName));
/// </code>
/// </remarks>
public static IGraphQLBuilder UseTelemetry(this IGraphQLBuilder builder, Action<GraphQLTelemetryOptions>? configure = null)
=> UseTelemetry<GraphQLTelemetryProvider>(builder, configure);
Expand Down

0 comments on commit 72a9775

Please sign in to comment.