You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- content: "You have deployed your cloud-native app to production. Some users are complaining that the product catalog is slow to load. You want to see how request durations vary over time. Which type of telemetry should you use?"
16
+
- content: "You deployed your cloud-native app to production. Some users are complaining that the product catalog is slow to load. You want to see how request durations vary over time. Which type of telemetry should you use?"
17
17
choices:
18
18
- content: "Logs"
19
19
isCorrect: false
20
-
explanation: "Incorrect. Logs provided a timestamped record of what happened, but it's not straight forward to display visually how durations vary."
20
+
explanation: "Incorrect. Logs provide a timestamped record of what happened, but it's not straightforward to display visually how durations vary."
21
21
- content: "Metrics"
22
22
isCorrect: true
23
23
explanation: "Correct. By using the request duration counter, you can display a graph in the .NET Aspire dashboard that shows how durations vary over various time periods."
24
24
- content: "Distributed traces"
25
25
isCorrect: false
26
-
explanation: "Incorrect. Distributed traces can show the duration of a single request but it's not straight forward to display visually how durations vary."
26
+
explanation: "Incorrect. Distributed traces can show the duration of a single request, but it's not straightforward to display visually how durations vary."
27
27
- content: "You're troubleshooting an issue with a microservice, which is experiencing crashes. Which type of telemetry should you use?"
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/use-telemetry-dotnet-aspire/includes/1-introduction.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
Cloud-native applications consist of independent microservices that may execute as a distributed set of containers. It can be difficult to study the behavior of the entire application to diagnose bugs or performance issues. You should consider early how to record telemetry data. .NET Aspire provides a dashboard that displays telemetry in a developer focused view.
2
-
1
+
Cloud-native applications consist of independent microservices that may execute as a distributed set of containers. It can be difficult to study the entire application's behavior to diagnose bugs or performance issues. You should consider early how to record telemetry data. .NET Aspire provides a dashboard that displays telemetry in a developer focused view.
2
+
3
3
Imagine you're an employee at an outdoor equipment retailer. You've started to build your new cloud-native app and you've integrated .NET Aspire to manage and connect your microservices. Now, you want to study the performance of the microservices and obtain details when bugs arise in your code.
4
4
5
-
In this module, you'll see how .NET Aspire makes it easy to both record and examine telemetry in a cloud-native app.
5
+
In this module, you'll learn how .NET Aspire makes it easy to both record and examine telemetry in a cloud-native app.
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/use-telemetry-dotnet-aspire/includes/2-telemetry-apis-dotnet.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
How can you investigate the behavior of an app for troubleshooting or performance optimization? The more data you have about what the app did, the easier it is to diagnose problems.
1
+
How can you investigate an app's behavior for troubleshooting or performance optimization? The more data you have about what the app did, the easier it is to diagnose problems.
2
2
3
-
Imagine you work for an outdoor equipment retailer. Your teams are building their microservices, ready for the testing phase. You want to ensure that your cloud-native app emits telemetry about its behavior so that you can diagnose problems during testing, staging, and production.
3
+
Imagine you work for an outdoor equipment retailer. Your teams are building their microservices and are ready for the testing phase. You want to ensure that your cloud-native app emits telemetry about its behavior so that you can diagnose problems during testing, staging, and production.
4
4
5
5
In this unit, you'll learn about telemetry and the different kinds of data you can record with it.
6
6
7
7
## What is telemetry?
8
8
9
-
In engineering, telemetry is the measurement of data and its automatic transmission to a central system for monitoring. For example, a racing car may record data about its performance and send it back to the paddock where engineers analyze it. Similarly a space capsule might record information about conditions in the capsule and send it back to mission control. In recent years, it's become common to record and analyze telemetry data in more common systems. For example, your central heating may send telemetry to the manufacturer to assist in troubleshooting.
9
+
In engineering, telemetry is the measurement of data and its automatic transmission to a central system for monitoring. For example, a racing car might record data about its performance and send it back to the paddock where engineers analyze it. Similarly, a space capsule might record information about conditions in the capsule and send it back to mission control. In recent years, it's become common to record and analyze telemetry data in more common systems. For example, your central heating might send telemetry to the manufacturer to assist in troubleshooting.
10
10
11
11
If you're writing cloud-native apps, telemetry is helpful when:
12
12
@@ -17,37 +17,37 @@ If you're writing cloud-native apps, telemetry is helpful when:
17
17
18
18
We can describe a system that emits rich telemetry as:
19
19
20
-
-**Observable**: An observable system is one that enables you to understand its behavior from outside it.
20
+
-**Observable**: An observable system is one that allows you to understand its behavior from outside the system.
21
21
-**Instrumented**: An instrumented system is one that emits all the data developers need to troubleshoot an issue.
22
22
23
23
**OpenTelemetry** is an observability framework and toolkit that you can use in your app to create, process, and emit telemetry data. You can easily add it to any .NET application, including microservices in a cloud-native app. It emits data in forms that common observability tools like Jaeger and Prometheus can use and analyze.
24
24
25
25
## Pillars of observability
26
26
27
-
The nature of cloud-native apps, which consist of distributed microservices that use disparate technologies, can make it difficult to build observable and properly instrumented code. All teams must integrate observability into their microservices, otherwise you may find that part of your app is difficult to monitor and troubleshoot.
27
+
The nature of cloud-native apps, which consist of distributed microservices that use disparate technologies, can make it difficult to build observable and properly instrumented code. All teams must integrate observability into their microservices, otherwise you might find that part of your app is difficult to monitor and troubleshoot.
28
28
29
29
> [!IMPORTANT]
30
30
> To ensure that your entire app is observable, you should ensure that all development teams consider the three pillars of observability in their microservices: **Logging**, **Metrics**, and **Tracing**.
31
31
32
32
The three pillars of observability are three different types of records that store the behavior of software integrations for later analysis:
33
33
34
-
-**Log**: a timestamped text record of what happened during the processing of a request.
35
-
-**Metric**: a measurement of a service captured at runtime. Metric values can be aggregated into statistics about a process, including:
36
-
- .NET Runtime statistics such as the memory used, or the number of garbage collections that occurred.
37
-
- ASP.NET or NuGet package statistics such as the number of completed requests, request durations, or error counts.
34
+
-**Log**: A timestamped text record of what happened during the processing of a request.
35
+
-**Metric**: A measurement of a service captured at runtime. Metric values can be aggregated into statistics about a process, including:
36
+
- .NET Runtime statistics, such as the memory used or the number of garbage collections that occurred.
37
+
- ASP.NET or NuGet package statistics, such as the number of completed requests, request durations, or error counts.
38
38
- Custom statistics that are specific to your app, such as the number of orders placed.
39
-
-**Distributed Trace**: a record of all the units of work, often referred to as **Spans**, needed to handle an individual request. In a cloud-native app, many microservices and backing services may be involved in a single request and a distributed trace would show all of them as they collaborate to prepare the response.
39
+
-**Distributed Trace**: A record of all the units of work, often referred to as *Spans*, needed to handle an individual request. In a cloud-native app, many microservices and backing services might be involved in a single request, and a distributed trace would show all of them as they collaborate to prepare the response.
40
40
41
41
> [!NOTE]
42
-
> In OpenTelemetry, any data that is not part of a distributed trace or a metric is considered to be a log, for example, events.
42
+
> In OpenTelemetry, any data that is not part of a distributed trace or a metric is considered to be a log; for example, events.
43
43
44
44
## Using telemetry in .NET
45
45
46
46
.NET has built-in types to represent the three pillars:
47
47
48
48
-**ILogger**: This interface provides a standard interface you can use when you what to log events from any .NET code.
49
49
-**Meter**: You can use this class to create a group of instruments, each of which measures a value associated with the performance or behavior of your code. For example, you could add an instrument that counts the sales of a product, or another that measures the length of time a message waited in a queue. .NET also provides many built-in metrics.
50
-
-**Activity**: You can use this class to record the tracing information. Start by creating an `ActivitySource` object for your namespace. Then call the `StartActivity` method to begin recording data.
50
+
-**Activity**: You can use this class to record the tracing information. Start by creating an `ActivitySource` object for your namespace, then call the `StartActivity` method to begin recording data.
51
51
52
52
You can use these classes in any .NET code. In the next unit you'll see how .NET Aspire makes it easier to use OpenTelemetry classes in cloud-native apps.
0 commit comments