Skip to content

Commit 4152d95

Browse files
Liudmila Molkovatrask
andcommitted
Apply suggestions from code review
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
1 parent 30a0745 commit 4152d95

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

oteps/4333-recording-exceptions-on-logs.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Recording exceptions is essential for troubleshooting, but regardless of how exc
4040
associated with ingesting and storing them. It's also common to log exceptions multiple times while they bubble up
4141
leading to duplication and aggravating the verbosity problem.
4242

43-
In this OTEP, we'll provide guidance around recording exceptions that minimizes duplication, allows to reduce noise with configuration and
44-
allows to capture exceptions in absence of a recorded span.
43+
In this OTEP, we'll provide guidance around recording exceptions that minimizes duplication, allows reducing noise with configuration, and
44+
allows capturing exceptions in the absence of a recorded span.
4545

4646
This guidance applies to general-purpose instrumentations including native ones. Application developers should consider following it as a
4747
starting point, but they are encouraged to adjust it to their needs.
@@ -50,17 +50,17 @@ starting point, but they are encouraged to adjust it to their needs.
5050

5151
This guidance boils down to the following:
5252

53-
Instrumentations should record exception information (along with other context) on the log record and
53+
Instrumentations should record exception information (along with other context) as a log record and
5454
use appropriate severity - only unhandled exceptions should be recorded as `Error` or higher.
5555
Instrumentations should strive to report each exception once.
5656

5757
Instrumentations should provide the whole exception instance to the OTel SDK (instead of individual attributes)
58-
and the SDK should, based on configuration, decide which information to record. As a default,
59-
this OTEP proposes to record exception stack traces on logs with `Error` or higher severity.
58+
and the SDK should, based on configuration, decide which information to record. The default SDK
59+
behavior should be to record exception stack traces when logging exceptions at `Error` or higher severity.
6060

6161
### Details
6262

63-
1. Exceptions should be recorded on [logs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md)
63+
1. Exceptions should be recorded as [logs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md)
6464
or [log-based events](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md)
6565

6666
2. Instrumentations for incoming requests, message processing, background job execution, or others that wrap user code and usually create local root spans, should record logs
@@ -72,11 +72,11 @@ this OTEP proposes to record exception stack traces on logs with `Error` or high
7272
[.NET guidance](https://github.com/open-telemetry/opentelemetry-dotnet/blob/610045298873397e55e0df6cd777d4901ace1f63/docs/trace/reporting-exceptions/README.md#unhandled-exception)
7373
for recording exceptions on traces.
7474

75-
3. Natively instrumented libraries should record log describing an error and the context it happened in
76-
when this error is detected (or where the most context is available).
75+
3. Natively instrumented libraries should record a log describing an exception and the context it happened in
76+
as soon as the exception is detected (or where the most context is available).
7777

78-
4. It's not recommended to record the same error as it propagates through the stack trace or
79-
attach the same instance of exception to multiple log records.
78+
4. It's not recommended to record the same exception as it propagates through the stack frames, or
79+
to attach the same instance of an exception to multiple log records.
8080

8181
5. An error should be logged with appropriate severity depending on the available context.
8282

@@ -85,7 +85,7 @@ this OTEP proposes to record exception stack traces on logs with `Error` or high
8585
- Unhandled exceptions that don't result in application shutdown should be recorded with severity `Error`
8686
- Errors that result in application shutdown should be recorded with severity `Fatal`.
8787

88-
6. When recording exception on logs, user applications and instrumentations are encouraged to put additional attributes
88+
6. When recording exception on logs, user applications and instrumentations are encouraged to add additional attributes
8989
to describe the context that the exception was thrown in.
9090
They are also encouraged to define their own error events and enrich them with exception details.
9191

@@ -103,9 +103,9 @@ this OTEP proposes to record exception stack traces on logs with `Error` or high
103103
> on the configuration and log severity.
104104
105105
It should not be an instrumentation library concern to decide whether exception stack trace should be recorded or not.
106-
Library may write logs providing exception instance through a log bridge and not be aware of this guidance.
106+
An instrumentation library may write logs providing an exception instance through a log bridge and not be aware of this guidance.
107107

108-
It also maybe desirable by some vendors/apps to record all exception details at all levels.
108+
It also may be desirable by some vendors/apps to record all exception details at all levels.
109109

110110
OTel Logs API should provide methods that enrich log record with exception details such as
111111
`setException(exception)` similar to [RecordException](../specification/trace/api.md?plain=1#L682)

0 commit comments

Comments
 (0)