Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<PackageVersion Include="OpenTelemetry" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.1" />
Comment thread
tobias-tengler marked this conversation as resolved.
<PackageVersion Include="Polly" Version="8.6.5" />
<PackageVersion Include="ProjNET" Version="2.0.0" />
<PackageVersion Include="RabbitMQ.Client" Version="7.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public static IDisposable CaptureActivities(out object activities)

var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddHotChocolateInstrumentation()
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddSource("Experimental.ModelContextProtocol")
.SetSampler(new AlwaysOnSampler())
.AddInMemoryExporter(exported)
.Build()!;
Expand Down Expand Up @@ -102,7 +105,13 @@ public Capture(TracerProvider tracerProvider, List<Activity> exported)
public OrderedDictionary<string, object?> Source
=> new()
{
["name"] = _exported.FirstOrDefault()?.Source.Name
// The first source name in stable (ordinal) order. Using the first exported
// activity is not deterministic once nested transport spans are involved,
// because the order in which sibling spans complete can vary between runs.
["name"] = _exported
.Select(a => a.Source.Name)
.OrderBy(name => name, StringComparer.Ordinal)
.FirstOrDefault()
};

[JsonProperty("activities", Order = 1)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<ItemGroup>
<PackageReference Include="OpenTelemetry" />
<PackageReference Include="OpenTelemetry.Exporter.InMemory" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,68 @@
},
"activities": [
{
"OperationName": "ExecuteHttpRequest",
"DisplayName": "GraphQL HTTP GET SDL",
"Kind": "Internal",
"Status": "Ok",
"OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn",
"DisplayName": "GET /graphql/{**slug}",
"Kind": "Server",
"Status": "Unset",
"tags": [
{
"Key": "graphql.http.kind",
"Value": "HttpGetSchema"
"Key": "server.address",
"Value": "localhost"
},
{
"Key": "graphql.schema.name",
"Value": "_Default"
"Key": "server.port",
"Value": 5000
},
{
"Key": "url.query",
"Value": "?sdl"
},
{
"Key": "http.request.method",
"Value": "GET"
},
{
"Key": "url.scheme",
"Value": "http"
},
{
"Key": "url.path",
"Value": "/graphql"
},
{
"Key": "network.protocol.version",
"Value": "1.1"
},
{
"Key": "http.route",
"Value": "/graphql/{**slug}"
},
{
"Key": "http.response.status_code",
"Value": 200
}
],
"event": []
"event": [],
"activities": [
{
"OperationName": "ExecuteHttpRequest",
"DisplayName": "GraphQL HTTP GET SDL",
"Kind": "Internal",
"Status": "Ok",
"tags": [
{
"Key": "graphql.http.kind",
"Value": "HttpGetSchema"
},
{
"Key": "graphql.schema.name",
"Value": "_Default"
}
],
"event": []
}
]
}
]
}
Loading
Loading