[{"data":1,"prerenderedAt":871},["ShallowReactive",2],{"i-feather:search":3,"i-feather:x":8,"i-feather:moon":10,"i-feather:sun":12,"i-lucide:house-heart":14,"i-fa-brands:youtube":16,"i-fa-brands:twitch":20,"i-fa-brands:github":22,"i-fa-brands:linkedin":25,"i-fa-brands:stack-overflow":28,"i-simple-icons:bluesky":31,"i-fa-brands:mastodon":33,"i-fa-regular:envelope":35,"i-fa-solid:rss":37,"post-\u002Fdeep-dive-into-open-telemetry-for-net\u002F":39,"i-fa-solid:share-alt":855,"i-fa-brands:facebook":857,"i-fa-brands:twitter":859,"i-fa-brands:reddit":861,"i-fa-brands:patreon":863,"i-simple-icons:buymeacoffee":865,"i-fa-brands:paypal":867,"i-fa-regular:question-circle":869},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"11\" cy=\"11\" r=\"8\"\u002F>\u003Cpath d=\"m21 21l-4.35-4.35\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18 6L6 18M6 6l12 12\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"5\"\u002F>\u003Cpath d=\"M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72l1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":15},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M8.62 13.8A2.25 2.25 0 1 1 12 10.836a2.25 2.25 0 1 1 3.38 2.966l-2.626 2.856a.998.998 0 0 1-1.507 0z\"\u002F>\u003Cpath d=\"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":17,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":19},576,512,"\u003Cpath fill=\"currentColor\" d=\"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597c-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821c11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305m-317.51 213.508V175.185l142.739 81.205z\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":21},"\u003Cpath fill=\"currentColor\" d=\"M391.17 103.47h-38.63v109.7h38.63ZM285 103h-38.63v109.75H285ZM120.83 0L24.31 91.42v329.16h115.83V512l96.53-91.42h77.25L487.69 256V0Zm328.24 237.75l-77.22 73.12h-77.24l-67.6 64v-64h-86.87V36.58h308.93Z\"\u002F>",{"left":4,"top":4,"width":23,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":24},496,"\u003Cpath fill=\"currentColor\" d=\"M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2\"\u002F>",{"left":4,"top":4,"width":26,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":27},448,"\u003Cpath fill=\"currentColor\" d=\"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3M135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5c0 21.3-17.2 38.5-38.5 38.5m282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7c-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5c67.2 0 79.7 44.3 79.7 101.9z\"\u002F>",{"left":4,"top":4,"width":29,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":30},384,"\u003Cpath fill=\"currentColor\" d=\"M290.7 311L95 269.7L86.8 309l195.7 41zm51-87L188.2 95.7l-25.5 30.8l153.5 128.3zm-31.2 39.7L129.2 179l-16.7 36.5L293.7 300zM262 32l-32 24l119.3 160.3l32-24zm20.5 328h-200v39.7h200zm39.7 80H42.7V320h-40v160h359.5V320h-40z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":32},"\u003Cpath fill=\"currentColor\" d=\"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037c-.856 3.061-3.978 3.842-6.755 3.37c4.854.826 6.089 3.562 3.422 6.299c-5.065 5.196-7.28-1.304-7.847-2.97c-.104-.305-.152-.448-.153-.327c0-.121-.05.022-.153.327c-.568 1.666-2.782 8.166-7.847 2.97c-2.667-2.737-1.432-5.473 3.422-6.3c-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026\"\u002F>",{"left":4,"top":4,"width":26,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":34},"\u003Cpath fill=\"currentColor\" d=\"M433 179.11c0-97.2-63.71-125.7-63.71-125.7c-62.52-28.7-228.56-28.4-290.48 0c0 0-63.72 28.5-63.72 125.7c0 115.7-6.6 259.4 105.63 289.1c40.51 10.7 75.32 13 103.33 11.4c50.81-2.8 79.32-18.1 79.32-18.1l-1.7-36.9s-36.31 11.4-77.12 10.1c-40.41-1.4-83-4.4-89.63-54a102.5 102.5 0 0 1-.9-13.9c85.63 20.9 158.65 9.1 178.75 6.7c56.12-6.7 105-41.3 111.23-72.9c9.8-49.8 9-121.5 9-121.5m-75.12 125.2h-46.63v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.33V197c0-58.5-64-56.6-64-6.9v114.2H90.19c0-122.1-5.2-147.9 18.41-175c25.9-28.9 79.82-30.8 103.83 6.1l11.6 19.5l11.6-19.5c24.11-37.1 78.12-34.8 103.83-6.1c23.71 27.3 18.4 53 18.4 175z\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":36},"\u003Cpath fill=\"currentColor\" d=\"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48m0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49c-16.841 13.247-50.201 45.072-73.413 44.701c-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646c21.857 17.205 60.134 55.186 103.062 54.955c42.717.231 80.509-37.199 103.053-54.947c49.528-38.783 82.032-64.401 104.947-82.653V400z\"\u002F>",{"left":4,"top":4,"width":26,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":38},"\u003Cpath fill=\"currentColor\" d=\"M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041s64.04 28.673 64.04 64.041m175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018c111.832 7.284 201.473 96.702 208.772 208.772c.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79m144.249.288C439.596 229.677 251.465 40.445 16.503 32.01C7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999c191.179 7.839 344.627 161.316 352.465 352.465c.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504\"\u002F>",{"id":40,"title":41,"author":42,"body":43,"comments":786,"date":825,"dateModified":826,"description":827,"extension":828,"headings":829,"heroImage":845,"meta":846,"path":55,"permalink":55,"published":847,"stem":848,"tags":849,"timeToRead":854},"posts\u002Fposts\u002F2021\u002Fopen-telemetry-for-net\u002Findex.md","Deep Dive into Open Telemetry for .NET","Muhammad Rehan Saeed",{"type":44,"value":45,"toc":783},"minimark",[46,75,101,104,127,139,150,153,165,176,179,182,194,197,205,215,218,229,236,261,268,275,286,289,300,303,306,317,335,346,349,370,373,384,395,410,429,432,448,459,470,480,490,540,551,554,575,578,589,592,601,657,660,665,678,689,701,704,722,725,728,739,745,751,757,765,776,779],[47,48,49,57,63,69],"ol",{},[50,51,52],"li",{},[53,54,56],"a",{"href":55},"\u002Fdeep-dive-into-open-telemetry-for-net\u002F","Open Telemetry - Deep Dive into Open Telemetry for .NET",[50,58,59],{},[53,60,62],{"href":61},"\u002Fopen-telemetry-for-asp-net-core\u002F","Open Telemetry - Configuring Open Telemetry for ASP.NET Core",[50,64,65],{},[53,66,68],{"href":67},"\u002Fexporting-open-telemetry-data-to-jaeger\u002F","Open Telemetry - Exporting Open Telemetry Data to Jaeger",[50,70,71],{},[53,72,74],{"href":73},"\u002Foptimally-configuring-open-telemetry-tracing-for-asp-net-core\u002F","Open Telemetry - Optimally Configuring Open Telemetry Tracing for ASP.NET Core",[76,77,78,79,88,89,94,95,100],"p",{},"Open Telemetry is an open source specification, tools and SDK's used to instrument, generate, collect, and export telemetry data (metrics, logs, and traces). ",[53,80,87],{"href":81,"rel":82,"target":86},"https:\u002F\u002Fopentelemetry.io\u002F",[83,84,85],"nofollow","noopener","noreferrer","_blank","Open Telemetry"," is backed by the ",[53,90,93],{"href":91,"rel":92,"target":86},"https:\u002F\u002Fwww.cncf.io\u002Fwebinars\u002Ffundamentals-of-opentelemetry\u002F",[83,84,85],"Cloud Native Computing Foundation (CNCF)"," which backs a mind boggling array of popular open source projects. It's worth looking at the ",[53,96,99],{"href":97,"rel":98,"target":86},"https:\u002F\u002Flandscape.cncf.io\u002F",[83,84,85],"CNCF Landscape"," to see what I really mean. The SDK's support all the major programming languages including C# and ASP.NET Core.",[76,102,103],{},"In this post, I'm going to discuss what Open Telemetry is all about, why you'd want to use it and how to use it with .NET specifically. With a typical application there are three sets of data that you usually want to record: metrics, logs and traces. Lets start by discussing what they are.",[105,106,108,126],"h2",{"id":107},"logging",[53,109,112],{"href":110,"aria-hidden":111},"#logging","true",[113,114,120],"svg",{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink","0 0 16 16","1.1",22,[121,122],"path",{"fill":123,"fill-rule":124,"d":125},"currentColor","evenodd","M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z","Logging",[76,128,129,130,134,135,138],{},"Provides insight into application-specific messages emitted by processes. In a .NET application, Open Telemetry support can easily be added if you use ",[131,132,133],"code",{},"ILogger"," for logging which lives in the ",[131,136,137],{},"Microsoft.Extensions.Logging"," NuGet package. You'd typically already use this if you're building an ASP.NET Core application.",[105,140,142,149],{"id":141},"metrics",[53,143,145],{"href":144,"aria-hidden":111},"#metrics",[113,146,147],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,148],{"fill":123,"fill-rule":124,"d":125},"Metrics",[76,151,152],{},"Provide quantitative information about processes running inside the system, including counters, gauges, and histograms. Support for metrics in Open Telemetry is still under development and being finalised at the time of writing. Examples of metrics are:",[154,155,156,159,162],"ul",{},[50,157,158],{},"Percentage CPU usage.",[50,160,161],{},"Bytes of memory used.",[50,163,164],{},"Number of HTTP requests.",[105,166,168,175],{"id":167},"tracing",[53,169,171],{"href":170,"aria-hidden":111},"#tracing",[113,172,173],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,174],{"fill":123,"fill-rule":124,"d":125},"Tracing",[76,177,178],{},"Also known as distributed tracing, this records the start and end times for individual operations alongside any ancillary data relevant to the operation. An example of this is recording a trace of a HTTP request in ASP.NET Core. You might record the start and end time of a request\u002Fresponse and the ancillary data would be the HTTP method, scheme, URL etc.",[76,180,181],{},"If an ASP.NET Core application makes database calls and HTTP requests to external API's these could also be recorded if the database and API's which are in totally separate processes also support recording Open Telemetry tracing. It's possible to follow the trace of a HTTP request from a client, down to your API, down to a database and all the way back again. This allows you to get a deep understanding of where the time is being spent or if there is an exception, where it is occurring.",[183,184,186,193],"h1",{"id":185},"jaeger",[53,187,189],{"href":188,"aria-hidden":111},"#jaeger",[113,190,191],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,192],{"fill":123,"fill-rule":124,"d":125},"Jaeger",[76,195,196],{},"Collecting metrics, logs and traces is only half of the equation, the other half is exporting that data to various applications that know how to collect Open Telemetry formatted data, so you can view it. The endgame is to be able to see your data in an easily consumable fashion using nice visualisations, so you can spot patterns and solve problems.",[76,198,199,200,204],{},"The two main applications that can collect and display Open Telemetry compatible trace data are ",[53,201,193],{"href":202,"rel":203,"target":86},"https:\u002F\u002Fwww.jaegertracing.io\u002F",[83,84,85]," and Zipkin. Zipkin is a bit older and doesn't have as nice a UI, so I'd personally recommend Jaeger. It looks something like this:",[76,206,207],{},[208,209],"img",{"alt":210,"src":211,"width":212,"height":213,"loading":214},"Jaeger Trace Detail","\u002Fcontent-images\u002Fposts\u002F2021\u002Fopen-telemetry-for-net\u002Fimages\u002FJaeger-Trace-Detail-3360x1859.png",3360,1859,"lazy",[76,216,217],{},"The above image shows the trace from a 'frontend' application. You can see how it makes calls to MySQL, Redis and external API's using HTTP requests. The length of each line shows how long it took to execute. You can easily see all of the major operations executed in a trace from end to end. You can also drill into each individual line and see extra information relevant to that part of the trace. I'll show you how you can run Jaeger and collect Open Telemetry data in my next blog post.",[183,219,221,228],{"id":220},"spans",[53,222,224],{"href":223,"aria-hidden":111},"#spans",[113,225,226],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,227],{"fill":123,"fill-rule":124,"d":125},"Spans",[76,230,231,232,235],{},"Each line in the Jaeger screenshot above is called a Span or in .NET is represented by the ",[131,233,234],{},"System.Activities.Activity"," type. It has a unique identifier, start and end time along with a parent span unique identifier too, so it can be connected to other spans in a tree structure representing an overall trace. Finally, a span can also contain other ancillary data that I will discuss further on.",[237,238,242,247,250],"div",{"className":239},[240,241],"custom-block","tip",[76,243,246],{"className":244},[245],"custom-block-title","Tip",[76,248,249],{},"Unfortunately, .NET's naming has significantly deviated from the official Open Telemetry specification, resulting in quite a lot of confusion on my part. Happily, I've been through that confusion, so you don't have to!",[76,251,252,253,256,257,260],{},"My understanding is that .NET already contained a type called ",[131,254,255],{},"Activity",", so the .NET team decided to reuse it instead of creating a new ",[131,258,259],{},"Span"," type like you'd expect. This means that a lot of naming does not match up with the Open Telemetry specification. From this point forward you can use the words 'span' and 'activity' interchangeably.",[76,262,263,264,267],{},"Recording your own traces using spans is pretty simple. First we must create an ",[131,265,266],{},"ActivitySource"," from which spans or activities can be recorded. This just contains a little information about the source of the spans created from it.",[269,270],"pre",{"className":271,"language":272,"meta":273,"style":273,"html":274},"language-cs shiki shiki-themes light-plus monokai","cs","","\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ActivitySource\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activitySource\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ActivitySource\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"swiDo\">    \"companyname.product.library\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"swiDo\">    \"semver1.0.0\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,276,277,278,281,282,285],{},"Then we can call ",[131,279,280],{},"StartActivity"," to start recording and finally call ",[131,283,284],{},"Dispose"," to stop recording the span.",[269,287],{"className":271,"language":272,"meta":273,"style":273,"html":288},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activitySource\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">StartActivity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"ActivityName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">    \u002F\u002F Pretend to do some work.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">().\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">} \u003C\u002Fspan>\u003Cspan class=\"s1q82\">\u002F\u002F Activity gets stopped automatically at end of this block during dispose.\n\u003C\u002Fspan>\u003C\u002Fspan>",[105,290,292,299],{"id":291},"events",[53,293,295],{"href":294,"aria-hidden":111},"#events",[113,296,297],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,298],{"fill":123,"fill-rule":124,"d":125},"Events",[76,301,302],{},"Along with our span we can record events. These are timestamped events that occur at a single point in time within your span.",[269,304],{"className":271,"language":272,"meta":273,"style":273,"html":305},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activitySource\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">StartActivity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"ActivityName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">().\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">public\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> async\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperationAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Delay\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"s0PsH\">1000\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">).\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">    \u002F\u002F Log timestamped events that can take place during an activity.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">    Activity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Current\u003C\u002Fspan>\u003Cspan class=\"snCLD\">?\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddEvent\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ActivityEvent\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"Something happened.\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,307,308,309,312,313,316],{},"Within the ",[131,310,311],{},"LongRunningOperationAsync"," method, we don't have access to the current span. One way to get hold of it would be to pass it in as a method parameter. However, a better way that decouples the two operations is to use ",[131,314,315],{},"Activity.Current"," which gives you access to the current span within the currently running thread.",[76,318,319,320,322,323,326,327,330,331,334],{},"One common pitfall I can foresee is that ",[131,321,315],{}," could be ",[131,324,325],{},"null"," due to the caller deciding not to create a span for some reason. Therefore, we use the null conditional operator ",[131,328,329],{},"?."," to only call ",[131,332,333],{},"AddEvent"," if the current span is not null.",[105,336,338,345],{"id":337},"attributes",[53,339,341],{"href":340,"aria-hidden":111},"#attributes",[113,342,343],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,344],{"fill":123,"fill-rule":124,"d":125},"Attributes",[76,347,348],{},"Attributes are name value pairs of data that you can record as part of an individual span. The attribute names have a loose standard for how they are put together that I'll talk about further on.",[237,350,352,355],{"className":351},[240,241],[76,353,246],{"className":354},[245],[76,356,357,360,361,363,364,369],{},[131,358,359],{},"Tags"," in .NET are called ",[131,362,345],{}," in the ",[53,365,368],{"href":366,"rel":367,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fapi.md#set-attributes",[83,84,85],"Open Telemetry specification",".",[269,371],{"className":271,"language":272,"meta":273,"style":273,"html":372},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activitySource\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">StartActivity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"ActivityName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">().\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">public\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> async\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperationAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Delay\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"s0PsH\">1000\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">).\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">    \u002F\u002F Log an attribute containing arbitrary data.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">    Activity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Current\u003C\u002Fspan>\u003Cspan class=\"snCLD\">?\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">SetTag\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"http.method\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"GET\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,374,375,376,379,380,383],{},"You can add new attributes or update existing attributes using the ",[131,377,378],{},"Activity.SetTag"," method. There is also an ",[131,381,382],{},"Activity.AddTag"," method but that will throw if an attribute does not already exist, so I'd avoid using it.",[183,385,387,394],{"id":386},"isrecording",[53,388,390],{"href":389,"aria-hidden":111},"#isrecording",[113,391,392],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,393],{"fill":123,"fill-rule":124,"d":125},"IsRecording",[76,396,397,399,400,402,403,406,407,409],{},[131,398,394],{}," is a flag on a span that returns ",[131,401,111],{}," if the end time of the span has not yet been set and ",[131,404,405],{},"false"," if it has, thus signifying whether the span has ended. In addition it can also be set to ",[131,408,405],{}," if the application is sampling Open Telemetry spans i.e. you don't want to collect a trace for every single execution of the code but might only want a trace for say 10% of executions to reduce the significant overhead of collecting telemetry.",[237,411,413,416],{"className":412},[240,241],[76,414,246],{"className":415},[245],[76,417,418,419,422,423,363,425,369],{},"The ",[131,420,421],{},"Activity.IsAllDataRequested"," property in .NET is called ",[131,424,394],{},[53,426,368],{"href":427,"rel":428,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fapi.md#isrecording",[83,84,85],[269,430],{"className":271,"language":272,"meta":273,"style":273,"html":431},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activitySource\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">StartActivity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"ActivityName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">().\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">public\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> async\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperationAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Delay\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"s0PsH\">1000\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">).\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">    \u002F\u002F It's possible to optionally request more data from a particular span.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">    var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Activity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Current\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sWm5y\">    if\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> !=\u003C\u002Fspan>\u003Cspan class=\"sMc8R\"> null\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> &amp;&amp;\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">IsAllDataRequested\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        activity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">SetTag\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"http.url\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"http:\u002F\u002Fwww.mywebsite.com\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,433,434,435,440,441,443,444,447],{},"It's worth reading a bit more about ",[53,436,439],{"href":437,"rel":438,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsdk.md#sampling",[83,84,85],"Open Telemetry Sampling"," for more details. In most real world applications, collecting telemetry for every execution of your code is prohibitively expensive and unrealistic, so you will likely be using some form of sampling. Therefore the ",[131,442,394],{},"\u002F",[131,445,446],{},"IsAllDataRequested"," flag becomes something you should probably always check (as in the above example) before you add events or attributes to your span.",[183,449,451,458],{"id":450},"trace-semantic-conventions",[53,452,454],{"href":453,"aria-hidden":111},"#trace-semantic-conventions",[113,455,456],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,457],{"fill":123,"fill-rule":124,"d":125},"Trace Semantic Conventions",[76,460,461,462,465,466,469],{},"Note the attribute names ",[131,463,464],{},"http.method"," and ",[131,467,468],{},"http.url"," I used in the above examples. There are certain commonly used attribute names that have been standardised in the Open Telemetry specification.",[76,471,472,473,476,477,479],{},"Standardised attribute names use a ",[131,474,475],{},"lower_kebab_case"," syntax with ",[131,478,369],{}," separator characters. Standardising the names of commonly used attribute names gives applications like Jaeger the ability to show nice UI customisations. Attribute names have been categorised under a few different buckets, it's worth spending some time taking a look at them:",[154,481,482],{},[50,483,484,489],{},[53,485,488],{"href":486,"rel":487,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Fspan-general.md",[83,84,85],"General",": General semantic attributes that may be used in describing different kinds of operations.",[154,491,492,500,508,516,524,532],{},[50,493,494,499],{},[53,495,498],{"href":496,"rel":497,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Fhttp.md",[83,84,85],"HTTP",": Spans for both HTTP client and server.",[50,501,502,507],{},[53,503,506],{"href":504,"rel":505,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Fdatabase.md",[83,84,85],"Database",": Spans for SQL and NoSQL client calls.",[50,509,510,515],{},[53,511,514],{"href":512,"rel":513,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Frpc.md",[83,84,85],"RPC\u002FRMI",": Spans for remote procedure calls (e.g., gRPC).",[50,517,518,523],{},[53,519,522],{"href":520,"rel":521,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Fmessaging.md",[83,84,85],"Messaging",": Spans for interaction with messaging systems (queues, publish\u002Fsubscribe, etc.).",[50,525,526,531],{},[53,527,530],{"href":528,"rel":529,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Ffaas.md",[83,84,85],"FaaS",": Spans for Function as a Service (e.g., AWS Lambda).",[50,533,534,539],{},[53,535,538],{"href":536,"rel":537,"target":86},"https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fopentelemetry-specification\u002Fblob\u002Fmaster\u002Fspecification\u002Ftrace\u002Fsemantic_conventions\u002Fexceptions.md",[83,84,85],"Exceptions",": Attributes for recording exceptions associated with a span.",[183,541,543,550],{"id":542},"exporting-telemetry",[53,544,546],{"href":545,"aria-hidden":111},"#exporting-telemetry",[113,547,548],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,549],{"fill":123,"fill-rule":124,"d":125},"Exporting Telemetry",[76,552,553],{},"There are many plugins for exporting data collected using Open Telemetry which I'll discuss in my next blog post about using Open Telemetry in ASP.NET Core. Therefore, it's highly unlikely that you'd need to manually write your own code to consume data collected using Open Telemetry.",[76,555,556,557,562,563,568,569,465,571,574],{},"However, if you're interested then ",[53,558,561],{"href":559,"rel":560,"target":86},"https:\u002F\u002Fjimmybogard.com",[83,84,85],"Jimmy Bogard"," has a very well written ",[53,564,567],{"href":565,"rel":566,"target":86},"https:\u002F\u002Fjimmybogard.com\u002Factivitysource-and-listener-in-net-5\u002F",[83,84,85],"blog post"," about using ",[131,570,266],{},[131,572,573],{},"ActivityListener"," to listen to any incoming telemetry. In short, you can easily subscribe to consume Open Telemetry data like so:",[269,576],{"className":271,"language":272,"meta":273,"style":273,"html":577},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> subscriber\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> DiagnosticListener\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">AllListeners\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Subscribe\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">    listener\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        Console\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">WriteLine\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">$\"Listener name \u003C\u002Fspan>\u003Cspan class=\"sfK3G\">{\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">listener\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Name\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">}\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        listener\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Subscribe\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">kvp\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =&gt;\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Console\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">WriteLine\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">$\"Received event \u003C\u002Fspan>\u003Cspan class=\"sfK3G\">{\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">kvp\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Key\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">}\u003C\u002Fspan>\u003Cspan class=\"swiDo\">:\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">{\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">kvp\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Value\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">}\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    });\n\u003C\u002Fspan>\u003C\u002Fspan>",[183,579,581,588],{"id":580},"crossing-the-process-boundary",[53,582,584],{"href":583,"aria-hidden":111},"#crossing-the-process-boundary",[113,585,586],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,587],{"fill":123,"fill-rule":124,"d":125},"Crossing the Process Boundary",[76,590,591],{},"Earlier on I spoke about how it's possible to record a trace across process boundaries. For example collecting a trace from a client application through to a database and API both running in separate processes. Given what you now know about recording spans above, how is this possible?",[76,593,594,595,600],{},"This is where the ",[53,596,599],{"href":597,"rel":598,"target":86},"https:\u002F\u002Fwww.w3.org\u002FTR\u002Ftrace-context\u002F",[83,84,85],"W3C Trace Context"," standard comes in. It defines a series of HTTP headers that pass information from one process to another about any trace that is currently being recorded. There are two HTTP headers defined in the specification:",[154,602,603,651],{},[50,604,605,625],{},[76,606,607,610,611,614,615,614,618,465,621,624],{},[131,608,609],{},"traceparent"," - Contains the ",[131,612,613],{},"version",", ",[131,616,617],{},"trace-id",[131,619,620],{},"parent-id",[131,622,623],{},"trace-flags"," in an encoded form separated by dashes.",[154,626,627,636,641,646],{},[50,628,629,631,632,635],{},[131,630,613],{}," - The version of Open Telemetry being used which is always ",[131,633,634],{},"00"," at the time of writing.",[50,637,638,640],{},[131,639,617],{}," - The unique identifier of the trace.",[50,642,643,645],{},[131,644,620],{}," - The unique identifier of the span which is acting as the current parent span.",[50,647,648,650],{},[131,649,623],{}," - A set of flags for the current trace which determines whether the current trace is being sampled and the trace level.",[50,652,653,656],{},[131,654,655],{},"tracestate"," - Vendor-specific data represented by a set of name\u002Fvalue pairs.",[76,658,659],{},"I'm not sure why but the HTTP headers are defined in lower-case. Here is an example of what these headers look like in a HTTP request:",[269,661],{"className":662,"language":663,"meta":273,"style":273,"html":664},"language-http shiki shiki-themes light-plus monokai","http","\u003Cspan class=\"line\">\u003Cspan class=\"sjbfc\">traceparent\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">:\u003C\u002Fspan>\u003Cspan class=\"swiDo\"> 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjbfc\">tracestate\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">:\u003C\u002Fspan>\u003Cspan class=\"swiDo\"> asp=00f067aa0ba902b7,redis=t61rcWkgMzE\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,666,667,668,671,672,677],{},"If you're interested in what it looks like to actually implement the W3C Trace Context, ",[53,669,561],{"href":559,"rel":670,"target":86},[83,84,85]," has been implementing ",[53,673,676],{"href":674,"rel":675,"target":86},"https:\u002F\u002Fjimmybogard.com\u002Fbuilding-end-to-end-diagnostics-and-tracing-a-primer-trace-context\u002F",[83,84,85],"Open Telemetry for NServiceBus"," and shows how it can be done.",[183,679,681,688],{"id":680},"baggage",[53,682,684],{"href":683,"aria-hidden":111},"#baggage",[113,685,686],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,687],{"fill":123,"fill-rule":124,"d":125},"Baggage",[76,690,691,692,694,695,700],{},"Similar to attributes, baggage is another way we can add data as name value pairs to a trace. The difference is that baggage travels across process boundaries using a ",[131,693,680],{}," HTTP header as defined in the ",[53,696,699],{"href":697,"rel":698,"target":86},"https:\u002F\u002Fwww.w3.org\u002FTR\u002Fbaggage\u002F",[83,84,85],"W3C Baggage"," specification. It is also added to all spans in a trace.",[269,702],{"className":662,"language":663,"meta":273,"style":273,"html":703},"\u003Cspan class=\"line\">\u003Cspan class=\"sjbfc\">baggage\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">:\u003C\u002Fspan>\u003Cspan class=\"swiDo\"> userId=alice,serverNode=DF:28,isProduction=false\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,705,706,707,465,710,713,714,717,718,721],{},"Similar to the way attributes can be recorded using the ",[131,708,709],{},"AddTag",[131,711,712],{},"SetTag"," methods, with baggage we can use the ",[131,715,716],{},"AddBaggage"," method. For some reason a ",[131,719,720],{},"SetBaggage"," method that would also update baggage does not exist.",[269,723],{"className":271,"language":272,"meta":273,"style":273,"html":724},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activity\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> activitySource\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">StartActivity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"ActivityName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">().\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">public\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> async\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> LongRunningOperationAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    await\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Delay\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"s0PsH\">1000\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">).\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureAwait\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">    \u002F\u002F Log an attribute containing arbitrary data.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">    Activity\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Current\u003C\u002Fspan>\u003Cspan class=\"snCLD\">?\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddBaggage\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"http.method\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"GET\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[76,726,727],{},"So why would you use baggage over attributes? Well, if you have a global unique identifier for a particular trace like a user ID, order ID or some session ID it might be useful to add it as baggage because it's relevant to all spans in your trace. However, you must be careful not to add too much baggage because it will add overhead when making HTTP requests.",[183,729,731,738],{"id":730},"youre-already-using-it",[53,732,734],{"href":733,"aria-hidden":111},"#youre-already-using-it",[113,735,736],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,737],{"fill":123,"fill-rule":124,"d":125},"You're Already Using It",[76,740,741,742,744],{},"The .NET team in their wisdom decided to take quite a large gamble on Open Telemetry. They not only repurposed their ",[131,743,255],{}," type to represent a span but they also instrumented several libraries, so you don't have to.",[76,746,418,747,750],{},[131,748,749],{},"HttpClient"," already adds the W3C Trace Context HTTP headers from the current span automatically if a trace is being recorded. Also an ASP.NET Core application already reads W3C Trace Context HTTP headers from incoming requests and populates the current span with that information.",[76,752,753,754,756],{},"Since the .NET team has made it so easy to collect telemetry and integrated the ",[131,755,255],{}," type into the base class libraries, I expect a lot of other libraries and applications to follow this example.",[76,758,418,759,761,762,764],{},[131,760,133],{}," interface from the ",[131,763,137],{}," NuGet package used commonly in an ASP.NET Core application is also able to collect logs compatible with Open Telemetry too.",[183,766,768,775],{"id":767},"up-next",[53,769,771],{"href":770,"aria-hidden":111},"#up-next",[113,772,773],{"xmlns":115,"xmlns:xlink":116,"viewBox":117,"version":118,"width":119,"height":119,"aria-hidden":111},[121,774],{"fill":123,"fill-rule":124,"d":125},"Up Next",[76,777,778],{},"I've discussed that Open Telemetry is all about collecting Logs, Metrics and Trace data and gone fairly deep into collecting Trace data. In my next post, I'll cover how you can configure ASP.NET Core and Open Telemetry traces and logs.",[780,781,782],"style",{},"html pre.shiki code .sJvqV, html code.shiki .sJvqV{--shiki-default:#0000FF;--shiki-dark:#F92672}html pre.shiki code .sw29p, html code.shiki .sw29p{--shiki-default:#267F99;--shiki-default-text-decoration:inherit;--shiki-dark:#A6E22E;--shiki-dark-text-decoration:underline}html pre.shiki code .sFrd5, html code.shiki .sFrd5{--shiki-default:#001080;--shiki-dark:#F8F8F2}html pre.shiki code .snCLD, html code.shiki .snCLD{--shiki-default:#000000;--shiki-dark:#F92672}html pre.shiki code .sjLUg, html code.shiki .sjLUg{--shiki-default:#000000;--shiki-dark:#F8F8F2}html pre.shiki code .swiDo, html code.shiki .swiDo{--shiki-default:#A31515;--shiki-dark:#E6DB74}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .smL5M, html code.shiki .smL5M{--shiki-default:#AF00DB;--shiki-dark:#F92672}html pre.shiki code .s4J9F, html code.shiki .s4J9F{--shiki-default:#0000FF;--shiki-default-font-style:inherit;--shiki-dark:#66D9EF;--shiki-dark-font-style:italic}html pre.shiki code .sWm5y, html code.shiki .sWm5y{--shiki-default:#795E26;--shiki-dark:#A6E22E}html pre.shiki code .s1q82, html code.shiki .s1q82{--shiki-default:#008000;--shiki-dark:#88846F}html pre.shiki code .sMc8R, html code.shiki .sMc8R{--shiki-default:#0000FF;--shiki-dark:#AE81FF}html pre.shiki code .s0PsH, html code.shiki .s0PsH{--shiki-default:#098658;--shiki-dark:#AE81FF}html pre.shiki code .sfK3G, html code.shiki .sfK3G{--shiki-default:#000000FF;--shiki-dark:#F8F8F2}html pre.shiki code .sjbfc, html code.shiki .sjbfc{--shiki-default:#800000;--shiki-dark:#F92672}",{"title":273,"searchDepth":784,"depth":784,"links":785},2,[],{"issue":787,"comments":791},{"number":788,"title":789,"html_url":790},247,"[Comment] Deep Dive into Open Telemetry for .NET","https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F247",[792,803,814],{"id":793,"html_url":794,"body_html":795,"created_at":796,"user":797,"reactions":801},773751631,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F247#issuecomment-773751631","\u003Cp>Can we send open telemerty traces into Azure App Insight?\u003C\u002Fp>","2021-02-05T03:03:15Z",{"login":798,"avatar_url":799,"html_url":800},"mirsaeedi","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2342405?v=4","https:\u002F\u002Fgithub.com\u002Fmirsaeedi",{"url":802,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F773751631\u002Freactions",{"id":804,"html_url":805,"body_html":806,"created_at":807,"user":808,"reactions":812},773932192,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F247#issuecomment-773932192","\u003Cp>You could but you'd have to write your own exporter as I don't currently see one in the registry for C#\u002F.NET although exporters for other languages exist:\u003C\u002Fp>\n\u003Cp>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Fopentelemetry.io\u002Fregistry\u002F?s=application+insights&amp;component=exporter&amp;language=\">https:\u002F\u002Fopentelemetry.io\u002Fregistry\u002F?s=application+insights&amp;component=exporter&amp;language=\u003C\u002Fa>\u003C\u002Fp>","2021-02-05T10:06:00Z",{"login":809,"avatar_url":810,"html_url":811},"RehanSaeed","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2270364?v=4","https:\u002F\u002Fgithub.com\u002FRehanSaeed",{"url":813,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F773932192\u002Freactions",{"id":815,"html_url":816,"body_html":817,"created_at":818,"user":819,"reactions":823},844112008,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F247#issuecomment-844112008","\u003Cp>Can we use it to capture trace information over for kafka producer and consumers?\u003C\u002Fp>","2021-05-19T13:34:36Z",{"login":820,"avatar_url":821,"html_url":822},"raunak2004","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2456025?v=4","https:\u002F\u002Fgithub.com\u002Fraunak2004",{"url":824,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F844112008\u002Freactions","2021-01-19T00:00:00+00:00",null,"How to use the Open Telemetry specification, tools and SDK's used to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) using .NET and ASP.NET.","md",[830,831,832,833,835,836,837,838,839,840,841,842,843,844],{"depth":784,"value":126},{"depth":784,"value":149},{"depth":784,"value":175},{"depth":834,"value":193},1,{"depth":834,"value":228},{"depth":784,"value":299},{"depth":784,"value":345},{"depth":834,"value":394},{"depth":834,"value":458},{"depth":834,"value":550},{"depth":834,"value":588},{"depth":834,"value":688},{"depth":834,"value":738},{"depth":834,"value":775},"\u002Fimages\u002Fhero\u002FOpen-Telemetry-1600x900.png",{},true,"posts\u002F2021\u002Fopen-telemetry-for-net\u002Findex",[87,850,851,852,149,126,175,853,259,255,93],".NET",".NET Core","ASP.NET Core","Distributed Tracing",10,{"left":4,"top":4,"width":26,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":856},"\u003Cpath fill=\"currentColor\" d=\"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.55 96.55 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.3 96.3 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96s-42.981-96-96-96\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":858},"\u003Cpath fill=\"currentColor\" d=\"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48c27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":860},"\u003Cpath fill=\"currentColor\" d=\"M459.37 151.716c.325 4.548.325 9.097.325 13.645c0 138.72-105.583 298.558-298.558 298.558c-59.452 0-114.68-17.219-161.137-47.106c8.447.974 16.568 1.299 25.34 1.299c49.055 0 94.213-16.568 130.274-44.832c-46.132-.975-84.792-31.188-98.112-72.772c6.498.974 12.995 1.624 19.818 1.624c9.421 0 18.843-1.3 27.614-3.573c-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319c-28.264-18.843-46.781-51.005-46.781-87.391c0-19.492 5.197-37.36 14.294-52.954c51.655 63.675 129.3 105.258 216.365 109.807c-1.624-7.797-2.599-15.918-2.599-24.04c0-57.828 46.782-104.934 104.934-104.934c30.213 0 57.502 12.67 76.67 33.137c23.715-4.548 46.456-13.32 66.599-25.34c-7.798 24.366-24.366 44.833-46.132 57.827c21.117-2.273 41.584-8.122 60.426-16.243c-14.292 20.791-32.161 39.308-52.628 54.253\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":862},"\u003Cpath fill=\"currentColor\" d=\"M201.5 305.5c-13.8 0-24.9-11.1-24.9-24.6c0-13.8 11.1-24.9 24.9-24.9c13.6 0 24.6 11.1 24.6 24.9c0 13.6-11.1 24.6-24.6 24.6M504 256c0 137-111 248-248 248S8 393 8 256S119 8 256 8s248 111 248 248m-132.3-41.2c-9.4 0-17.7 3.9-23.8 10c-22.4-15.5-52.6-25.5-86.1-26.6l17.4-78.3l55.4 12.5c0 13.6 11.1 24.6 24.6 24.6c13.8 0 24.9-11.3 24.9-24.9s-11.1-24.9-24.9-24.9c-9.7 0-18 5.8-22.1 13.8l-61.2-13.6c-3-.8-6.1 1.4-6.9 4.4l-19.1 86.4c-33.2 1.4-63.1 11.3-85.5 26.8c-6.1-6.4-14.7-10.2-24.1-10.2c-34.9 0-46.3 46.9-14.4 62.8c-1.1 5-1.7 10.2-1.7 15.5c0 52.6 59.2 95.2 132 95.2c73.1 0 132.3-42.6 132.3-95.2c0-5.3-.6-10.8-1.9-15.8c31.3-16 19.8-62.5-14.9-62.5M302.8 331c-18.2 18.2-76.1 17.9-93.6 0c-2.2-2.2-6.1-2.2-8.3 0c-2.5 2.5-2.5 6.4 0 8.6c22.8 22.8 87.3 22.8 110.2 0c2.5-2.2 2.5-6.1 0-8.6c-2.2-2.2-6.1-2.2-8.3 0m7.7-75c-13.6 0-24.6 11.1-24.6 24.9c0 13.6 11.1 24.6 24.6 24.6c13.8 0 24.9-11.1 24.9-24.6c0-13.8-11-24.9-24.9-24.9\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":864},"\u003Cpath fill=\"currentColor\" d=\"M512 194.8c0 101.3-82.4 183.8-183.8 183.8c-101.7 0-184.4-82.4-184.4-183.8c0-101.6 82.7-184.3 184.4-184.3C429.6 10.5 512 93.2 512 194.8M0 501.5h90v-491H0z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":866},"\u003Cpath fill=\"currentColor\" d=\"m20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379c-.197-.069-.42-.098-.57-.241c-.152-.143-.196-.366-.231-.572c-.065-.378-.125-.756-.192-1.133c-.057-.325-.102-.69-.25-.987c-.195-.4-.597-.634-.996-.788a6 6 0 0 0-.626-.194c-1-.263-2.05-.36-3.077-.416a26 26 0 0 0-3.7.062c-.915.083-1.88.184-2.75.5c-.318.116-.646.256-.888.501c-.297.302-.393.77-.177 1.146c.154.267.415.456.692.58c.36.162.737.284 1.123.366c1.075.238 2.189.331 3.287.37q1.829.074 3.65-.118q.449-.05.896-.119c.352-.054.578-.513.474-.834c-.124-.383-.457-.531-.834-.473c-.466.074-.96.108-1.382.146q-1.767.12-3.536.006a22 22 0 0 1-1.157-.107c-.086-.01-.18-.025-.258-.036q-.364-.055-.724-.13c-.111-.027-.111-.185 0-.212h.005q.416-.09.838-.147h.002c.131-.009.263-.032.394-.048a25 25 0 0 1 3.426-.12q1.011.029 2.017.144l.228.031q.4.06.798.145c.392.085.895.113 1.07.542c.055.137.08.288.111.431l.319 1.484a.237.237 0 0 1-.199.284h-.003l-.112.015a37 37 0 0 1-4.743.295a37 37 0 0 1-4.699-.304c-.14-.017-.293-.042-.417-.06c-.326-.048-.649-.108-.973-.161c-.393-.065-.768-.032-1.123.161c-.29.16-.527.404-.675.701c-.154.316-.199.66-.267 1c-.069.34-.176.707-.135 1.056c.087.753.613 1.365 1.37 1.502a39.7 39.7 0 0 0 11.343.376a.483.483 0 0 1 .535.53l-.071.697l-1.018 9.907c-.041.41-.047.832-.125 1.237c-.122.637-.553 1.028-1.182 1.171q-.868.197-1.756.205c-.656.004-1.31-.025-1.966-.022c-.699.004-1.556-.06-2.095-.58c-.475-.458-.54-1.174-.605-1.793l-.731-7.013l-.322-3.094c-.037-.351-.286-.695-.678-.678c-.336.015-.718.3-.678.679l.228 2.185l.949 9.112c.147 1.344 1.174 2.068 2.446 2.272c.742.12 1.503.144 2.257.156c.966.016 1.942.053 2.892-.122c1.408-.258 2.465-1.198 2.616-2.657l1.024-9.995l.215-2.087a.48.48 0 0 1 .39-.426c.402-.078.787-.212 1.074-.518c.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233c-2.416.359-4.866.54-7.308.46c-1.748-.06-3.477-.254-5.207-.498c-.17-.024-.353-.055-.47-.18c-.22-.236-.111-.71-.054-.995c.052-.26.152-.609.463-.646c.484-.057 1.046.148 1.526.22q.865.132 1.737.212c2.48.226 5.002.19 7.472-.14q.675-.09 1.345-.21c.399-.072.84-.206 1.08.206c.166.281.188.657.162.974a.54.54 0 0 1-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a6 6 0 0 1-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38c0 0 1.243.065 1.658.065c.447 0 1.786-.065 1.786-.065c.783 0 1.434-.6 1.499-1.38l.94-9.95a4 4 0 0 0-1.322-.238c-.826 0-1.491.284-2.26.613\"\u002F>",{"left":4,"top":4,"width":29,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":868},"\u003Cpath fill=\"currentColor\" d=\"M111.4 295.9c-3.5 19.2-17.4 108.7-21.5 134c-.3 1.8-1 2.5-3 2.5H12.3c-7.6 0-13.1-6.6-12.1-13.9L58.8 46.6c1.5-9.6 10.1-16.9 20-16.9c152.3 0 165.1-3.7 204 11.4c60.1 23.3 65.6 79.5 44 140.3c-21.5 62.6-72.5 89.5-140.1 90.3c-43.4.7-69.5-7-75.3 24.2M357.1 152c-1.8-1.3-2.5-1.8-3 1.3c-2 11.4-5.1 22.5-8.8 33.6c-39.9 113.8-150.5 103.9-204.5 103.9c-6.1 0-10.1 3.3-10.9 9.4c-22.6 140.4-27.1 169.7-27.1 169.7c-1 7.1 3.5 12.9 10.6 12.9h63.5c8.6 0 15.7-6.3 17.4-14.9c.7-5.4-1.1 6.1 14.4-91.3c4.6-22 14.3-19.7 29.3-19.7c71 0 126.4-28.8 142.9-112.3c6.5-34.8 4.6-71.4-23.8-92.6\"\u002F>",{"left":4,"top":4,"width":18,"height":18,"rotate":4,"vFlip":6,"hFlip":6,"body":870},"\u003Cpath fill=\"currentColor\" d=\"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8m0 448c-110.532 0-200-89.431-200-200c0-110.495 89.472-200 200-200c110.491 0 200 89.471 200 200c0 110.53-89.431 200-200 200m107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516c17.561-9.845 28.324-16.541 28.324-29.579c0-17.246-21.999-28.693-39.784-28.693c-23.189 0-33.894 10.977-48.942 29.969c-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8M298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42s18.841-42 42-42s42 18.841 42 42\"\u002F>",1792940323290]