From the course: DevOps Foundations: Distributed Tracing

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding metadata to your traces

Adding metadata to your traces

From the course: DevOps Foundations: Distributed Tracing

Start my 1-month free trial

Adding metadata to your traces

- [Instructor] In the next example I'll show you how we can add tags and metadata to our spans. And we'll also use a technique to reduce the spanning boilerplate code that we have to write. So let's get started. So I'll use the same global scope that we created on line 126 and again I will keep our long span as well. And now I'm going to create another span that will illustrate how we can handle an error message and nest children spans. So again I will create a span object, call this span two. Again we're going to grab a instance of our tracer. We will build a span. And this span we can name something to what the application or this part of the application may be doing so maybe process receipt. Just like in the previous example we will use the as child of command so we can connect this span to the parent. And we'll start it. Okay, so at this point we've started a new span called span two. So here we'll start with our again whether try catch blocks in case there's an error. And again…

Contents