Description
I captured an output of a trivial ASP.NET application with OpenTelemetry enabled using dotnet monitor and saved it as nettrace file.
I can see variety of diagnostic spans in perfview. Here is an example of one of the spans dumped from perfview:
<Event MSec= "10953.3116" PID="57408" PName="Process(57408)" TID="48304" ActivityID="0000261c0000000000000000895f9d59" EventName="Activity2/Start"
TimeStamp="01/17/23 15:51:35.463311" ID="161" Version="0" Keywords="0x0000F00000000002" TimeStampQPC="5,434,001,567,795" QPCTime="0.100us"
Level="Informational" ProviderName="Microsoft-Diagnostics-DiagnosticSource" ProviderGuid="adb401e1-5296-51f8-c125-5fda75826144" ClassicProvider="False" ProcessorNumber="0"
ActivityID="/#57408/1/38/" RawActivityID="0000261c-0000-0000-0000-0000895f9d59"
Opcode="1" Task="Default" Channel="0" PointerSize="8"
CPU="0" EventIndex="158993" TemplateType="DynamicTraceEventData">
<PrettyPrint>
<Event MSec= "10953.3116" PID="57408" PName="Process(57408)" TID="48304" ActivityID="0000261c0000000000000000895f9d59" EventName="Activity2/Start" ProviderName="Microsoft-Diagnostics-DiagnosticSource" SourceName="HttpHandlerDiagnosticListener" EventName="System.Net.Http.HttpRequestOut.Start" Arguments="[RequestUri->"http://localhost:4318/v1/traces",Method->"POST",Host->"localhost",Port->"4318",ActivityStartTime->"638095962954638706",ActivityId->"00-517d6a43b5bbca8850bc775b012b96ee-dfcdaaa229305ebd-00",ActivitySpanId->"dfcdaaa229305ebd",ActivityTraceId->"517d6a43b5bbca8850bc775b012b96ee",ActivityParentSpanId->"0000000000000000",ActivityIdFormat->"W3C",ActivityId->"00-517d6a43b5bbca8850bc775b012b96ee-dfcdaaa229305ebd-00"]"/>
</PrettyPrint>
<Payload Length="918">
0: 48 0 74 0 74 0 70 0 | 48 0 61 0 6e 0 64 0 H.t.t.p. H.a.n.d.
10: 6c 0 65 0 72 0 44 0 | 69 0 61 0 67 0 6e 0 l.e.r.D. i.a.g.n.
20: 6f 0 73 0 74 0 69 0 | 63 0 4c 0 69 0 73 0 o.s.t.i. c.L.i.s.
30: 74 0 65 0 6e 0 65 0 | 72 0 0 0 53 0 79 0 t.e.n.e. r...S.y.
40: 73 0 74 0 65 0 6d 0 | 2e 0 4e 0 65 0 74 0 s.t.e.m. ..N.e.t.
50: 2e 0 48 0 74 0 74 0 | 70 0 2e 0 48 0 74 0 ..H.t.t. p...H.t.
60: 74 0 70 0 52 0 65 0 | 71 0 75 0 65 0 73 0 t.p.R.e. q.u.e.s.
70: 74 0 4f 0 75 0 74 0 | 2e 0 53 0 74 0 61 0 t.O.u.t. ..S.t.a.
80: 72 0 74 0 0 0 b 0 | 52 0 65 0 71 0 75 0 r.t..... R.e.q.u.
90: 65 0 73 0 74 0 55 0 | 72 0 69 0 0 0 68 0 e.s.t.U. r.i...h.
a0: 74 0 74 0 70 0 3a 0 | 2f 0 2f 0 6c 0 6f 0 t.t.p.:. /./.l.o.
b0: 63 0 61 0 6c 0 68 0 | 6f 0 73 0 74 0 3a 0 c.a.l.h. o.s.t.:.
c0: 34 0 33 0 31 0 38 0 | 2f 0 76 0 31 0 2f 0 4.3.1.8. /.v.1./.
d0: 74 0 72 0 61 0 63 0 | 65 0 73 0 0 0 4d 0 t.r.a.c. e.s...M.
e0: 65 0 74 0 68 0 6f 0 | 64 0 0 0 50 0 4f 0 e.t.h.o. d...P.O.
f0: 53 0 54 0 0 0 48 0 | 6f 0 73 0 74 0 0 0 S.T...H. o.s.t...
...
2a0: 69 0 76 0 69 0 74 0 | 79 0 50 0 61 0 72 0 i.v.i.t. y.P.a.r.
2b0: 65 0 6e 0 74 0 53 0 | 70 0 61 0 6e 0 49 0 e.n.t.S. p.a.n.I.
2c0: 64 0 0 0 30 0 30 0 | 30 0 30 0 30 0 30 0 d...0.0. 0.0.0.0.
2d0: 30 0 30 0 30 0 30 0 | 30 0 30 0 30 0 30 0 0.0.0.0. 0.0.0.0.
2e0: 30 0 30 0 0 0 41 0 | 63 0 74 0 69 0 76 0 0.0...A. c.t.i.v.
2f0: 69 0 74 0 79 0 49 0 | 64 0 46 0 6f 0 72 0 i.t.y.I. d.F.o.r.
300: 6d 0 61 0 74 0 0 0 | 57 0 33 0 43 0 0 0 m.a.t... W.3.C...
310: 41 0 63 0 74 0 69 0 | 76 0 69 0 74 0 79 0 A.c.t.i. v.i.t.y.
320: 49 0 64 0 0 0 30 0 | 30 0 2d 0 35 0 31 0 I.d...0. 0.-.5.1.
330: 37 0 64 0 36 0 61 0 | 34 0 33 0 62 0 35 0 7.d.6.a. 4.3.b.5.
340: 62 0 62 0 63 0 61 0 | 38 0 38 0 35 0 30 0 b.b.c.a. 8.8.5.0.
350: 62 0 63 0 37 0 37 0 | 35 0 62 0 30 0 31 0 b.c.7.7. 5.b.0.1.
360: 32 0 62 0 39 0 36 0 | 65 0 65 0 2d 0 64 0 2.b.9.6. e.e.-.d.
370: 66 0 63 0 64 0 61 0 | 61 0 61 0 32 0 32 0 f.c.d.a. a.a.2.2.
380: 39 0 33 0 30 0 35 0 | 65 0 62 0 64 0 2d 0 9.3.0.5. e.b.d.-.
390: 30 0 30 0 0 0 | 0.0...
</Payload>
</Event>
I then converted the trace:
PS > dotnet trace convert .\20230117_235124_505_57408.nettrace --format Chromium
Writing: ...\dotnet-trace\20230117_235124_505_57408.chromium.json
Conversion complete
chrome://tracing and https://ui.perfetto.dev/ do not open the file. The reason is that the json is malformed. This event is not valid JSON because quotes and other special characters are not escaped:
{"name": "Activity System.Net.Http.HttpRequestOut.Start(/#57408/1/38/,RequestUri=" http: //localhost:4318/v1/traces" Method="POST" Host="localhost" Port="4318" ActivityStartTime="638095962954638706" ActivityId="00-517d6a43b5bbca8850bc775b012b96ee-dfcdaaa229305ebd-00" ActivitySpanId="dfcdaaa229305ebd" ActivityTraceId="517d6a43b5bbca8850bc775b012b96ee" ActivityParentSpanId="0000000000000000" ActivityIdFormat="W3C" ActivityId="00-517d6a43b5bbca8850bc775b012b96ee-dfcdaaa229305ebd-00")", "cat": "sampleEvent", "ph": "B", "ts": 10953.442, "pid": 0, "tid": 48304, "sf": 28}
Configuration
Dotnet monitor version:
PS C:\Users\Daniel.Odievich> dotnet monitor --version
7.0.1+efc97faf4554c1acf65e4b75e3fb0dbcc1399ae7
Dotnet trace version:
PS C:\observe\dotnet-trace> dotnet trace --version
6.0.351802+ca25fd472e7dd6501d4a85973e0d0326c856880d
Dotnet info:
PS C:\Users\Daniel.Odievich> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.405
Commit: 27ab36058b
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.405\
global.json file:
Not found
Host:
Version: 6.0.13
Architecture: x64
Commit: 1af80ba017
.NET SDKs installed:
6.0.405 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Seems related #1370?
Description
I captured an output of a trivial ASP.NET application with OpenTelemetry enabled using dotnet monitor and saved it as nettrace file.
I can see variety of diagnostic spans in perfview. Here is an example of one of the spans dumped from perfview:
I then converted the trace:
chrome://tracing and https://ui.perfetto.dev/ do not open the file. The reason is that the json is malformed. This event is not valid JSON because quotes and other special characters are not escaped:
{"name": "Activity System.Net.Http.HttpRequestOut.Start(/#57408/1/38/,RequestUri=" http: //localhost:4318/v1/traces" Method="POST" Host="localhost" Port="4318" ActivityStartTime="638095962954638706" ActivityId="00-517d6a43b5bbca8850bc775b012b96ee-dfcdaaa229305ebd-00" ActivitySpanId="dfcdaaa229305ebd" ActivityTraceId="517d6a43b5bbca8850bc775b012b96ee" ActivityParentSpanId="0000000000000000" ActivityIdFormat="W3C" ActivityId="00-517d6a43b5bbca8850bc775b012b96ee-dfcdaaa229305ebd-00")", "cat": "sampleEvent", "ph": "B", "ts": 10953.442, "pid": 0, "tid": 48304, "sf": 28}Configuration
Dotnet monitor version:
Dotnet trace version:
Dotnet info:
Seems related #1370?