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
Copy file name to clipboardExpand all lines: src/content/docs/identityserver/diagnostics/logging.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,3 +114,7 @@ var isBuilder = builder.Services.AddIdentityServer(options =>
114
114
```
115
115
116
116
Returning `true` means the exception will be logged, while returning `false` indicates the exception should not be logged.
117
+
118
+
## OpenTelemetry
119
+
120
+
Logs written to the standard `ILogger` system in .NET 8+ can be exported to OpenTelemetry traces at runtime. This helps visualize when the log statement occurred in relation to the entire request. The logs are augmented with trace ids and correlated with traces. Have a look at [logs in OpenTelemetry](/identityserver/diagnostics/otel.md#logs) for setup details.
Copy file name to clipboardExpand all lines: src/content/docs/identityserver/diagnostics/otel.md
+60-9Lines changed: 60 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,20 +19,20 @@ redirect_from:
19
19
Added in Duende IdentityServer v6.1 and expanded in v7.0
20
20
:::
21
21
22
-
[OpenTelemetry](https://opentelemetry.io) is a collection of tools, APIs, and SDKs for generating and collecting
22
+
[OpenTelemetry](https://opentelemetry.io)(OTel) is a collection of tools, APIs, and SDKs for generating and collecting
23
23
telemetry data (metrics, logs, and traces). This is very useful for analyzing software performance and behavior,
24
24
especially in highly distributed systems.
25
25
26
-
.NET 8 comes with first class support for OpenTelemetry. IdentityServer emits traces, metrics, and logs.
27
26
28
-
### Metrics
27
+
##OpenTelemetry Signals
29
28
30
-
Metrics are high level statistic counters. They provide an aggregated overview and can be used to set monitoring rules.
29
+
OpenTelemetry signals are the information collected and processed to describe the internal activity of the system. The most common signals are traces, metrics, and logs.
31
30
32
-
### Logs
31
+
.NET 8+ comes with first class support for OpenTelemetry. IdentityServer emits traces, metrics, and logs you can collect.
33
32
34
-
OpenTelemetry in .NET 8 exports the logs written to the standard ILogger system. The logs are augmented with
35
-
trace ids to be able to correlate log entries with traces.
33
+
### Metrics
34
+
35
+
Metrics are high level statistic counters. They provide an aggregated overview and can be used to set monitoring rules.
36
36
37
37
### Traces
38
38
@@ -45,20 +45,47 @@ IdentityServer to get a new access token and then calls the API. The API reads t
@@ -432,3 +459,27 @@ You can select which information you are interested in by selectively listening
432
459
**`IdentityServerConstants.Tracing.Validation`*
433
460
434
461
More detailed tracing related to validation
462
+
463
+
## OpenTelemetry From 3rd Party Logging Frameworks
464
+
465
+
If you're unable to use the `ILogger` system in .NET, your choice of logging framework may be able to push log messages to traces. You can view their documentation to set that up.
466
+
467
+
### OpenTelemetry with Serilog
468
+
469
+
If you are logging with Serilog and want to use that framework's native API to push log messages to traces, you need to:
470
+
471
+
* Add the Serilog OpenTelemetry sink library
472
+
* Instruct the Serilog logger object to write to the OpenTelemetry sink
473
+
474
+
Note: See the Serilog [OpenTelemetry sink](https://github.com/serilog/serilog-sinks-opentelemetry) documentation for the most up to date information.
0 commit comments