Click on a span for more information. information about the trace such as and . You should also see multiple ones, one of which you set manually. View internal traces Add tracing for your queries In this section you will learn how to trace database queries. Initially you will do this manually by creating the span yourself. Although manual tracking is no longer required but implementing it will give you a better understanding of how tracking works. You'll then do the same thing automatically using the new tracking feature in . Tracking your queries manually To track queries manually you must wrap each query in a span. You can do this by adding the following.
Code to your copy of the file you have crea photo editing servies ted a new range called query. You also made some changes to how your variables are declared to make them consistent with the rest of your code. Test the new span by querying the endpoint again and viewing the newly generated trace in . In Visualizing Subspans you should see that the resulting trace has a new subspan called nested below the parent scope. Now you can check Look at the request duration taken to execute the query. Manual vs. automatic instrumentation Since you are setting up automatic instrumentation you no longer need to manually create spans for queries. Updating by deleting the manual range of a query The order in which tracking.
Additional queries you add to your application after enabling auto-detection will also automatically generate traces. Note To learn more about generated spans see the Trace Output section of the Trace documentation. To set up automatic detection you currently track endpoints by manually creating spans. Just like queries manual tracking will become unmanageable as the number of endpoints increases. To solve this problem you can also set up automatic detection. First install the following instrumentation libraries Copy Register the two new instrument is initialized is important when using automatic detection for replication. You need to set up tracking and register detections before importing the detection library.